Click to See Complete Forum and Search --> : Draw icon automaticly?


Robuster
April 30th, 2009, 04:51 AM
Hello
I am wondering how i can draw an icon automaticly and save it?
Pretty much just an icon with random colors on it

Mike Harnad
April 30th, 2009, 08:29 AM
This (http://msdn.microsoft.com/en-us/library/ms648051(VS.85).aspx) should get you started.

srelu
May 19th, 2009, 06:21 PM
Drawing an icon is almost the same as drawing a bitmap. You'll need for an icon two bitmaps, one the XOR MASK (a colour bitmap), the second one the AND MASK (a monochrome bitmap). While the first bitmap holds the actual image, the second bitmap decides what parts of the image will be transparent.

Another way to draw an icon is to draw directly a PNG image using GDI+. In this case there is only one image, because the PNG image can store internally the transparency information.

The best results can be obtained with the PNG image, but PNG icons can be used only with Vista.
Also, 32 bit bitmap icons can be used only in XP or newer OS.

Normally an icon file holds multiple icons, sized 16x16, 32x32, 48X48, 96X96, 128X128, 256X256 or even nonstandard sizes (up to maximum 256X256). Each of this sizes can be present in multiple color formats, 1, 4, 8 or 32 bits per pixel.

A serious icon file can hold tens of icons having different sizes and color formats to match any requirement.

How to save an icon file ? To do that you need to know the format of an ICO file. Look for it on www.wotsit.org (http://www.wotsit.org) .

Just something more about the PNG icons...

In the ico file you have a general header (6 bytes long), after that follows specific headers for each icon, then the data for each icon.

For BMP style icons, that data consists of a modified version of a BITMAPINFOHEADER followed by a color table (if necessary) then followed by the XOR MASK pixels, then followed by the AND MASK pixels (see the ICO file format).

For the PNG style icons, being something recent, you'll find no informations. The PNG icon has a specific header made in the same way as for a BMP style icon. The data for the PNG icon is actually the content of a PNG file from the first to the last byte. You can use GDI+ to save the PNG file after you draw it, then load it again as an ordinary file and include it completely in the ico file.

ddrrkk
May 20th, 2009, 05:02 AM
Hello
I am wondering how i can draw an icon automaticly and save it?

Do you mean you are finding a program auto draw icon? How about BS icon maker?

carl666
May 23rd, 2009, 10:42 AM
How to save an icon file ? To do that you need to know the format of an ICO file.

No, useless.
Use standard Win32 COM apis to load and save icons. (12 lines of code)

srelu
June 8th, 2009, 03:47 PM
No, useless.
Use standard Win32 COM apis to load and save icons. (12 lines of code)

fred100 with a new nick but the same old pointless messages. Have you ever tried to create an ico file ?