Difference between revisions of "SaveIcon32"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Odin
(48 intermediate revisions by one other user not shown)
Line 1: Line 1:
The following Icon creation procedure was adapted from Galleon's [[SAVEIMAGE]] sup-procedure that creats 8 BPP or 32 bit bitmaps:
+
The following Icon creation procedure was adapted from Galleon's [[SAVEIMAGE]] sup-procedure that creates 8 BPP or 32 bit bitmaps:
  
 +
 +
<center>'''NOTE: QB64 cannot use Icon Images or Icons as the [[_ICON]] in the TITLE bar!'''</center>
 
{{CodeStart}} '' ''
 
{{CodeStart}} '' ''
 
DO
 
DO
 
   {{Cl|LINE INPUT}} "Use 8 bit(256 colors) or 32 bit image? ", bit$
 
   {{Cl|LINE INPUT}} "Use 8 bit(256 colors) or 32 bit image? ", bit$
   mode% = {{Cl|VAL}}(bit$)
+
   clrmode% = {{Cl|VAL}}(bit$)
{{Cl|LOOP}} {{Cl|UNTIL}} mode% = 8 {{Cl|OR (boolean)|OR}} mode% = 32
+
{{Cl|LOOP}} {{Cl|UNTIL}} clrmode% = 8 {{Cl|OR (boolean)|OR}} clrmode% = 32
{{Cl|IF...THEN|IF}} mode% = 8 {{Cl|THEN}} mode% = 256
+
{{Cl|IF...THEN|IF}} clrmode% = 8 {{Cl|THEN}} clrmode% = 256
{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, mode%)
+
{{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} "Do you wish to make black transparent? (Y/N) ";
 +
K$ = {{Cl|INPUT$}}(1): {{Cl|PRINT}} K$
 +
{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(K$) = "Y" {{Cl|THEN}} mode% = 1
 +
{{Cl|_DELAY}} 1
 +
{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, clrmode%)
 +
DO
 +
  {{Cl|LOCATE}} 10, 10: {{Cl|LINE INPUT}} "Enter the icon size to use(multiple of 16): ", sz$
 +
  size& = {{Cl|VAL}}(sz$)
 +
{{Cl|LOOP}} {{Cl|UNTIL}} size& {{Cl|MOD}} 16 = 0 AND size& >= 16 AND size& <= 128
 
DO
 
DO
 
   {{Cl|LOCATE}} 10, 10: {{Cl|LINE INPUT}} "Enter the image file name to convert to an icon: ", BMP$
 
   {{Cl|LOCATE}} 10, 10: {{Cl|LINE INPUT}} "Enter the image file name to convert to an icon: ", BMP$
Line 15: Line 25:
 
{{Cl|IF...THEN|IF}} img& = -1 {{Cl|OR (boolean)|OR}} img& = 0 {{Cl|THEN}} {{Cl|LOCATE}} 15, 25: {{Cl|PRINT}} "Image failed to load!": {{Cl|END}}
 
{{Cl|IF...THEN|IF}} img& = -1 {{Cl|OR (boolean)|OR}} img& = 0 {{Cl|THEN}} {{Cl|LOCATE}} 15, 25: {{Cl|PRINT}} "Image failed to load!": {{Cl|END}}
  
{{Cl|CLS}} , {{Cl|_RGB}}(255, 255, 255)
+
{{Cl|IF...THEN|IF}} mode% = 0 THEN {{Cl|CLS}} , {{Cl|_RGB}}(255, 255, 255)
{{Cl|IF...THEN|IF}} mode% = 256 {{Cl|THEN}} {{Cl|_COPYPALETTE}} (img&)
+
{{Cl|IF...THEN|IF}} clrmode% = 256 {{Cl|THEN}} {{Cl|_COPYPALETTE}} (img&)
{{Cl|_PUTIMAGE}} (0, 0)-(31, 31), img&, 0
+
{{Cl|_PUTIMAGE}} (0, 0)-(size& - 1, size& - 1), img&, 0 '(31, 31), img&, 0 '<<<<<<<<<<<
  
{{Cl|LOCATE}} 20, 10: {{Cl|PRINT}} "Do you want to make an icon out of the image? (Y/N)"
+
{{Cl|LOCATE}} 20, 10: {{Cl|PRINT}} "Do you want to make an icon out of the image? (Y/N) ";
K$ = {{Cl|INPUT$}}(1)
+
K$ = {{Cl|INPUT$}}(1): {{Cl|PRINT}} K$
 
{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(K$) <> "Y" {{Cl|THEN}} {{Cl|END}}
 
{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(K$) <> "Y" {{Cl|THEN}} {{Cl|END}}
 
SaveFile$ = {{Cl|LEFT$}}(BMP$, {{Cl|INSTR}}(BMP$, ".")) + "ico"
 
SaveFile$ = {{Cl|LEFT$}}(BMP$, {{Cl|INSTR}}(BMP$, ".")) + "ico"
SaveIcon32 img&, SaveFile$
+
SaveIcon32 img&, size&, mode%, SaveFile$
  
{{Cl|END}}
+
{{Cl|END}}  
'-----------------------------------------------------------------------------------
+
'             ---------------------------------------------------------
  
{{Cl|SUB}} SaveIcon32 (image {{Cl|AS}} {{Cl|LONG}}, filename {{Cl|AS}} {{Cl|STRING}})
+
{{Cl|SUB}} SaveIcon32 (image {{Cl|AS}} {{Cl|LONG}}, size {{Cl|AS}} {{Cl|LONG}}, mode AS {{Cl|INTEGER}}, filename {{Cl|AS}} {{Cl|STRING}})
 
bytesperpixel& = {{Cl|_PIXELSIZE}}(image&)
 
bytesperpixel& = {{Cl|_PIXELSIZE}}(image&)
 
{{Cl|IF...THEN|IF}} bytesperpixel& = 0 {{Cl|THEN}} {{Cl|PRINT}} "Text modes unsupported!": {{Cl|END}}
 
{{Cl|IF...THEN|IF}} bytesperpixel& = 0 {{Cl|THEN}} {{Cl|PRINT}} "Text modes unsupported!": {{Cl|END}}
{{Cl|IF...THEN|IF}} bytesperpixel& = 1 {{Cl|THEN}} bpp& = 8: bp% = 1 {{Cl|ELSE}} bpp& = 24: bp% = 3
+
{{Cl|IF...THEN|IF}} bytesperpixel& = 1 {{Cl|THEN}} bpp& = 8 {{Cl|ELSE}} bpp& = 24 '256 or 32 bit color
x& = 32 '{{Cl|_WIDTH (function)|_WIDTH}}(image&)
+
{{Cl|IF...THEN|IF}} size& {{Cl|MOD}} 16 {{Cl|OR}} size& < 16 {{Cl|OR}} size& > 128 THEN {{Cl|PRINT}} "Size not supported!": {{Cl|END}}
y& = 32 '{{Cl|_HEIGHT}}(image&)
+
x& = size& 'supports sizes from 16 to 128 only!
'                           32 x 32 colors                          size - 22 offset
+
y& = size&
b$= {{Cl|MKI$}}(0)+{{Cl|MKI$}}(1)+{{Cl|MKI$}}(1)+{{Cl|SPACE$}}(2)+{{Cl|CHR$}}(0)+{{Cl|CHR$}}(0)+{{Cl|MKI$}}(0)+{{Cl|MKI$}}(0)+"????"+{{Cl|MKL$}}(22) _
+
'Headers:  icon    count  width    depth    colors          cursor hotspots size - offset
+{{Cl|MKL$}}(40)+{{Cl|MKL$}}(x&)+{{Cl|MKL$}}(2 * y&)+{{Cl|MKI$}}(1)+{{Cl|MKI$}}(bpp&)+{{Cl|MKL$}}(0)+{{Cl|MKL$}}(1024 * bp%)+{{Cl|MKL$}}(0)+{{Cl|MKL$}}(0)+{{Cl|MKL$}}(0)+{{Cl|MKL$}}(0)
+
b$= {{Cl|MKI$}}(0)+{{Cl|MKI$}}(1)+{{Cl|MKI$}}(1)+{{Cl|CHR$}}(x&)+{{Cl|CHR$}}(y&)+{{Cl|CHR$}}(0)+{{Cl|CHR$}}(0)+{{Cl|MKI$}}(0)+{{Cl|MKI$}}(0)+"????"+{{Cl|MKL$}}(22) _
'header              2 * wide  planes   BPP                   XOR size
+
+{{Cl|MKL$}}(40)+{{Cl|MKL$}}(x&)+{{Cl|MKL$}}(2 * y&)+{{Cl|MKI$}}(1)+{{Cl|MKI$}}(bpp&)+{{Cl|MKL$}}(0)+"????" + {{Cl|STRING$}}(16, 0)
 +
'BMP size  width   double height  plane    BPP             raw size
 
{{Cl|IF...THEN|IF}} bytesperpixel& = 1 {{Cl|THEN}}
 
{{Cl|IF...THEN|IF}} bytesperpixel& = 1 {{Cl|THEN}}
 
   {{Cl|FOR...NEXT|FOR}} c& = 0 {{Cl|TO}} 255 ' read BGR color settings from image + 1 byte spacer({{Cl|CHR$}}(0))
 
   {{Cl|FOR...NEXT|FOR}} c& = 0 {{Cl|TO}} 255 ' read BGR color settings from image + 1 byte spacer({{Cl|CHR$}}(0))
 
     cv& = {{Cl|_PALETTECOLOR (function)|_PALETTECOLOR}}(c&, image&) ' color attribute to read.
 
     cv& = {{Cl|_PALETTECOLOR (function)|_PALETTECOLOR}}(c&, image&) ' color attribute to read.
     b$ = b$ + {{Cl|CHR$}}({{Cl|_BLUE32}}(cv&)) + {{Cl|CHR$}}({{Cl|_GREEN32}}(cv&)) + {{Cl|CHR$}}({{Cl|_RED32}}(cv&)) + {{Cl|CHR$}}(0) 'spacer byte
+
     b$ = b$ + {{Cl|CHR$}}({{Cl|_BLUE32}}(cv&)) + {{Cl|CHR$}}({{Cl|_GREEN32}}(cv&)) + {{Cl|CHR$}}({{Cl|_RED32}}(cv&)) + {{Cl|CHR$}}(0) 'spacer
 
   {{Cl|NEXT}}
 
   {{Cl|NEXT}}
 
{{Cl|END IF}}
 
{{Cl|END IF}}
 
lastsource& = {{Cl|_SOURCE}}
 
lastsource& = {{Cl|_SOURCE}}
{{Cl|_SOURCE}} 0
+
{{Cl|_SOURCE}} 0 'set source as program screen. Do NOT use loaded image handle as size has changed!
'{{Cl|IF...THEN|IF}} ((x& * 3) {{Cl|MOD}} 4) {{Cl|THEN}} padder$ = {{Cl|SPACE$}}(4 - ((x& * 3) {{Cl|MOD}} 4)) 'not used in 32 X 32
+
{{Cl|IF...THEN|IF}} ((x& * 3) {{Cl|MOD}} 4) {{Cl|THEN}} padder$ = {{Cl|STRING$}}(4 - ((x& * 3) {{Cl|MOD}} 4), 0)
{{Cl|FOR...NEXT|FOR}} py& = y& - 1 {{Cl|TO}} 0 {{Cl|STEP}} -1 ' read JPG image pixel color data
+
{{Cl|FOR...NEXT|FOR}} py& = y& - 1 {{Cl|TO}} 0 {{Cl|STEP}} -1 ' read target image pixel color data
 
   r$ = ""
 
   r$ = ""
 
   {{Cl|FOR...NEXT|FOR}} px& = 0 {{Cl|TO}} x& - 1
 
   {{Cl|FOR...NEXT|FOR}} px& = 0 {{Cl|TO}} x& - 1
Line 53: Line 64:
 
     {{Cl|IF...THEN|IF}} bytesperpixel& = 1 {{Cl|THEN}} r$ = r$ + {{Cl|CHR$}}(c&) {{Cl|ELSE}} r$ = r$ + {{Cl|LEFT$}}({{Cl|MKL$}}(c&), 3)
 
     {{Cl|IF...THEN|IF}} bytesperpixel& = 1 {{Cl|THEN}} r$ = r$ + {{Cl|CHR$}}(c&) {{Cl|ELSE}} r$ = r$ + {{Cl|LEFT$}}({{Cl|MKL$}}(c&), 3)
 
   {{Cl|NEXT}} px&
 
   {{Cl|NEXT}} px&
   d$ = d$ + r$ '+ padder$
+
   d$ = d$ + r$ + padder$
 
{{Cl|NEXT}} py&
 
{{Cl|NEXT}} py&
a$ = {{Cl|STRING$}}(bp% * x& * y& \ 8, 0) 'totally black {{Cl|AND (boolean)|AND}} mask
+
{{Cl|IF...THEN|IF}} (x& {{Cl|MOD}} 32) {{Cl|THEN}} bitpad& = 32 - (x& {{Cl|MOD}} 32) 'padder bits when not multiples of 32
 +
{{Cl|IF...THEN|IF}} mode% {{Cl|THEN}} 'make black pixels white in AND mask so they become transparent
 +
  {{Cl|FOR...NEXT|FOR}} py& = y& - 1 {{Cl|TO}} 0 {{Cl|STEP}} -1 'read image to find black pixels
 +
    px& = 0
 +
    {{Cl|DO...LOOP|DO}}: byte% = 0
 +
      {{Cl|FOR...NEXT|FOR}} bit% = 7 {{Cl|TO}} 0 {{Cl|STEP}} -1 'change transparent color to suit your needs
 +
        byte% = 2 * byte% - ({{Cl|POINT}}(px&, py&) = {{Cl|_RGB}}(0, 0, 0)) 'bitpacking adds 1 when true
 +
        px& = px& + 1
 +
      {{Cl|NEXT}}
 +
      a$ = a$ + {{Cl|CHR$}}(byte%)
 +
    {{Cl|LOOP}} {{Cl|WHILE}} px& < x& - 1
 +
    {{Cl|IF...THEN|IF}} bitpad& {{Cl|THEN}} a$ = a$ + {{Cl|STRING$}}((bitpad& + 7) \ 8, 0) 'add padder at end of row when necessary
 +
  {{Cl|NEXT}}
 +
{{Cl|ELSE}} a$ = {{Cl|STRING$}}(y& * ((x& + bitpad& + 7) \ 8), 0) 'totally black {{Cl|AND (boolean)|AND}} mask
 +
{{Cl|END IF}}
 
d$ = d$ + a$
 
d$ = d$ + a$
 
{{Cl|_SOURCE}} lastsource&
 
{{Cl|_SOURCE}} lastsource&
'{{Cl|MID$}}(b$, 43, 4) = {{Cl|MKL$}}({{Cl|LEN}}(d$)) ' image size with AND mask or just 1024 * bp%
+
{{Cl|MID$}}(b$, 43, 4) = {{Cl|MKL$}}({{Cl|LEN}}(d$)) 'raw image size with {{Cl|AND}} mask
 
b$ = b$ + d$ ' total file data bytes to create file
 
b$ = b$ + d$ ' total file data bytes to create file
{{Cl|MID$}}(b$, 15, 4) = {{Cl|MKL$}}({{Cl|LEN}}(b$) - 22) 'size of raw data(Entry header)
+
{{Cl|MID$}}(b$, 15, 4) = {{Cl|MKL$}}({{Cl|LEN}}(b$) - 22) ' size of data file minus Entry header offset
 
{{Cl|IF...THEN|IF}} {{Cl|LCASE$}}({{Cl|RIGHT$}}(filename$, 4)) <> ".ico" {{Cl|THEN}} ext$ = ".ico"
 
{{Cl|IF...THEN|IF}} {{Cl|LCASE$}}({{Cl|RIGHT$}}(filename$, 4)) <> ".ico" {{Cl|THEN}} ext$ = ".ico"
 
f& = {{Cl|FREEFILE}}
 
f& = {{Cl|FREEFILE}}
Line 67: Line 92:
 
{{Cl|PUT}} #f&, , b$
 
{{Cl|PUT}} #f&, , b$
 
{{Cl|CLOSE}} #f&
 
{{Cl|CLOSE}} #f&
{{Cl|END SUB}}
+
{{Cl|END SUB}} '' ''
 
{{CodeEnd}}
 
{{CodeEnd}}
 
{{small|Code by Ted Weissgerber}}
 
{{small|Code by Ted Weissgerber}}
: ''Explanation:'' The icons created only have a black [[AND]] mask for simplicity so the background is changed to white using [[CLS]].
+
: ''Explanation:'' The icons created can have a full black [[AND]] mask for a solid square image when mode% is zero. If mode% is a value other than 0, the AND mask routine looks for black pixels and sets the background pixel on for transparency. Icons with dimensions that are not a multiple of 32 would require padding. In the header, ???? is later replaced with size data. If the image is 24/32 BPP, the size of the [[XOR]] image data will triple because each pixel uses 3 bytes for red, green and blue values up to 255.
: [[SPACE$]](2) gives the icon entry header the 32 X 32 dimensions as spaces are [[CHR$]](32). Smaller icons would require padding.  
+
:{{text|To create '''.CUR''' cursor files change the second value from 1 to 2 and set the 2 cursor click hotspot offset [[INTEGER]] values.|purple}}
: In the header, ???? is later replaced with size data. If the image is 24/32 BPP, the size of the image data will triple with '''bp%'''.
+
<center>'''Note: Icon sizes that are not multiples of 32 require AND mask width padding to multiples of 4 bytes!'''</center>
 +
{{TextStart}} IF Width {{Cb|MOD}} 32 THEN ANDpad% = 32 - (Width MOD 32) '{{Cb|BIT|bits}}, divide by 8 to get {{Cb|BYTE|bytes}} {{TextEnd}}
 +
: Icons that are 16 X 16 or 48 X 48 require 2 padder bytes to be added at the end of each row increasing data size by 32 and 96.
  
  
 
''See also:''
 
''See also:''
 +
* [[_ICON]]
 +
* [[SAVEIMAGE]]
 
* [[Icons and Cursors]]
 
* [[Icons and Cursors]]
 +
* [[Resource_Table_extraction#Extract_Icon|Icon Extraction]]
 
* [[Bitmaps]]
 
* [[Bitmaps]]
 +
* [[GIF Images]]
 +
* [[Embedding Icons in EXE]] {{text|(Icons visible in Windows Explorer)}}
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Revision as of 03:51, 22 January 2020

The following Icon creation procedure was adapted from Galleon's SAVEIMAGE sup-procedure that creates 8 BPP or 32 bit bitmaps:


NOTE: QB64 cannot use Icon Images or Icons as the _ICON in the TITLE bar!

DO LINE INPUT "Use 8 bit(256 colors) or 32 bit image? ", bit$ clrmode% = VAL(bit$) LOOP UNTIL clrmode% = 8 OR clrmode% = 32 IF clrmode% = 8 THEN clrmode% = 256 LOCATE 10, 10: PRINT "Do you wish to make black transparent? (Y/N) "; K$ = INPUT$(1): PRINT K$ IF UCASE$(K$) = "Y" THEN mode% = 1 _DELAY 1 SCREEN _NEWIMAGE(640, 480, clrmode%) DO LOCATE 10, 10: LINE INPUT "Enter the icon size to use(multiple of 16): ", sz$ size& = VAL(sz$) LOOP UNTIL size& MOD 16 = 0 AND size& >= 16 AND size& <= 128 DO LOCATE 10, 10: LINE INPUT "Enter the image file name to convert to an icon: ", BMP$ CLS LOOP UNTIL _FILEEXISTS(BMP$) img& = _LOADIMAGE(BMP$) IF img& = -1 OR img& = 0 THEN LOCATE 15, 25: PRINT "Image failed to load!": END IF mode% = 0 THEN CLS , _RGB(255, 255, 255) IF clrmode% = 256 THEN _COPYPALETTE (img&) _PUTIMAGE (0, 0)-(size& - 1, size& - 1), img&, 0 '(31, 31), img&, 0 '<<<<<<<<<<< LOCATE 20, 10: PRINT "Do you want to make an icon out of the image? (Y/N) "; K$ = INPUT$(1): PRINT K$ IF UCASE$(K$) <> "Y" THEN END SaveFile$ = LEFT$(BMP$, INSTR(BMP$, ".")) + "ico" SaveIcon32 img&, size&, mode%, SaveFile$ END ' --------------------------------------------------------- SUB SaveIcon32 (image AS LONG, size AS LONG, mode AS INTEGER, filename AS STRING) bytesperpixel& = _PIXELSIZE(image&) IF bytesperpixel& = 0 THEN PRINT "Text modes unsupported!": END IF bytesperpixel& = 1 THEN bpp& = 8 ELSE bpp& = 24 '256 or 32 bit color IF size& MOD 16 OR size& < 16 OR size& > 128 THEN PRINT "Size not supported!": END x& = size& 'supports sizes from 16 to 128 only! y& = size& 'Headers: icon count width depth colors cursor hotspots size - offset b$= MKI$(0)+MKI$(1)+MKI$(1)+CHR$(x&)+CHR$(y&)+CHR$(0)+CHR$(0)+MKI$(0)+MKI$(0)+"????"+MKL$(22) _ +MKL$(40)+MKL$(x&)+MKL$(2 * y&)+MKI$(1)+MKI$(bpp&)+MKL$(0)+"????" + STRING$(16, 0) 'BMP size width double height plane BPP raw size IF bytesperpixel& = 1 THEN FOR c& = 0 TO 255 ' read BGR color settings from image + 1 byte spacer(CHR$(0)) cv& = _PALETTECOLOR(c&, image&) ' color attribute to read. b$ = b$ + CHR$(_BLUE32(cv&)) + CHR$(_GREEN32(cv&)) + CHR$(_RED32(cv&)) + CHR$(0) 'spacer NEXT END IF lastsource& = _SOURCE _SOURCE 0 'set source as program screen. Do NOT use loaded image handle as size has changed! IF ((x& * 3) MOD 4) THEN padder$ = STRING$(4 - ((x& * 3) MOD 4), 0) FOR py& = y& - 1 TO 0 STEP -1 ' read target image pixel color data r$ = "" FOR px& = 0 TO x& - 1 c& = POINT(px&, py&) IF bytesperpixel& = 1 THEN r$ = r$ + CHR$(c&) ELSE r$ = r$ + LEFT$(MKL$(c&), 3) NEXT px& d$ = d$ + r$ + padder$ NEXT py& IF (x& MOD 32) THEN bitpad& = 32 - (x& MOD 32) 'padder bits when not multiples of 32 IF mode% THEN 'make black pixels white in AND mask so they become transparent FOR py& = y& - 1 TO 0 STEP -1 'read image to find black pixels px& = 0 DO: byte% = 0 FOR bit% = 7 TO 0 STEP -1 'change transparent color to suit your needs byte% = 2 * byte% - (POINT(px&, py&) = _RGB(0, 0, 0)) 'bitpacking adds 1 when true px& = px& + 1 NEXT a$ = a$ + CHR$(byte%) LOOP WHILE px& < x& - 1 IF bitpad& THEN a$ = a$ + STRING$((bitpad& + 7) \ 8, 0) 'add padder at end of row when necessary NEXT ELSE a$ = STRING$(y& * ((x& + bitpad& + 7) \ 8), 0) 'totally black AND mask END IF d$ = d$ + a$ _SOURCE lastsource& MID$(b$, 43, 4) = MKL$(LEN(d$)) 'raw image size with AND mask b$ = b$ + d$ ' total file data bytes to create file MID$(b$, 15, 4) = MKL$(LEN(b$) - 22) ' size of data file minus Entry header offset IF LCASE$(RIGHT$(filename$, 4)) <> ".ico" THEN ext$ = ".ico" f& = FREEFILE OPEN filename$ + ext$ FOR OUTPUT AS #f&: CLOSE #f& ' erases an existing file OPEN filename$ + ext$ FOR BINARY AS #f& PUT #f&, , b$ CLOSE #f& END SUB

Code by Ted Weissgerber
Explanation: The icons created can have a full black AND mask for a solid square image when mode% is zero. If mode% is a value other than 0, the AND mask routine looks for black pixels and sets the background pixel on for transparency. Icons with dimensions that are not a multiple of 32 would require padding. In the header, ???? is later replaced with size data. If the image is 24/32 BPP, the size of the XOR image data will triple because each pixel uses 3 bytes for red, green and blue values up to 255.
To create .CUR cursor files change the second value from 1 to 2 and set the 2 cursor click hotspot offset INTEGER values.
Note: Icon sizes that are not multiples of 32 require AND mask width padding to multiples of 4 bytes!

IF Width MOD 32 THEN ANDpad% = 32 - (Width MOD 32) 'bits, divide by 8 to get bytes

Icons that are 16 X 16 or 48 X 48 require 2 padder bytes to be added at the end of each row increasing data size by 32 and 96.


See also:



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page