ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

Could someone convert a .png into an .ico for me?

<< < (5/6) > >>

app103:
but it seems to work fine in Win7.
-Krishean (February 10, 2012, 06:04 PM)
--- End quote ---

Doesn't work in XP.

vlastimil:
... I wonder what the header does:


--- ---00 00 01 00 01 00 00 00 00 00 01 00 20 00 52 36
06 00 16 00 00 00 [png file starts here]
-Krishean (February 10, 2012, 06:04 PM)
--- End quote ---

It is the icon header consisting of:
00 00 - marker part 1
01 00 - marker part 2
01 00 - number of images in the .ico file

following the entries for each image in the .ico file (1 in this case):

00 - width (0=256)
00 - height (0=256)
00 - color count (only applies to images with palette)
00 - reserved
01 00 - planes (always 1)
20 00 - color depth in bits (32 in this case)
52 36 06 00 - length of the image data
16 00 00 00 - offset of the image data in the file

As I said before, max. allowed size is 256x256 pixels. This is an invalid .ico file, because the size specified in the header differs from the actual size. Icons usually contain multiple images (that's the point of .ico files) and Windows chooses the best image by looking at the header. Invalid header -> Windows is confused. If you had both 256x256 and 512x512 images in the .ico file, Windows would see them as indistinguishable.

Also, what's the point of having an .ico with 512x512 image instead of plain .png image? I do not think Windows can effectively use it, the icon sizes Explorer and other windows components display are limited to 256x256 pixels anyway.

Stoic Joker:
Well this has certainly been an educational question. :) Networking I can do in my sleep, media and graphics formats OTOH ... I'm dumber than a stump. Thanks for the info vlastimil!

Also, what's the point of having an .ico with 512x512 image instead of plain .png image? I do not think Windows can effectively use it, the icon sizes Explorer and other windows components display are limited to 256x256 pixels anyway.-vlastimil (February 11, 2012, 01:55 AM)
--- End quote ---

(guessing this is directed at me) Well... I'd actually thought that somewhere in the Vista/7 range that the icons had been bumped up to 512. So I was trying to reuse a single .ico file to (control compiled binary size) be used as both the main app icon, and a splash screen/about dialog image. I'd actually first experimented with this in Got Space during the last NANY.  The first builds contained an about dialog that displayed only a large image of/from the app icon's .ico file. It took a while to figure out how to get the .ico to display full size, but once I got it to "behave" (deleting reaganging bits), it would fill the entire dialog window. If the max size image in the .ico file was smaller than 512x512 the image displayed in the dialog would also be smaller and not fill the window. *Shrug* I assumed... The behavior was correct (/confirmational) and not (apparently) just a hack/fluke.

So I was planning to reuse this method to get the .ico file to also supply the 512x512 graphic for the onload splash screen...because it seemed to have worked before.



On a side note: I am using that image for a business management program because it is going to need to be put into limited production use in a "modular fashion" (e.g. before it is completely finished). The graphic is to remind everyone (that the freaking back door is wide open) of the risk involved in this behavior.

vlastimil:
I see. I would not use such a non-standard .ico file as the main icon of the application.

In the about dialog, it may be OK (on Vista and Win 7) - I would still try to use a .png file for this instead. Not sure how hard it would be with your implementation of the about box.

(Vista actually introduced the 256x256 icons. On XP, the typical max. size was 48x48.)

app103:
(Vista actually introduced the 256x256 icons. On XP, the typical max. size was 48x48.)
-vlastimil (February 11, 2012, 12:15 PM)
--- End quote ---

A 48x48 icon is quite small when displayed in Explorer on XP, like so:



But XP is quite capable of displaying 128x128, like so:



And even Win9x is capable of displaying greater than 48x48. I have had much success with 256 color icons measuring 99x99.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version