Prev: catching HSHELL_GETMINRECT in shell hook
Next: Loading Res... Error -- ERROR_RESOURCE_NAME_NOT_FOUND
From: [Jongware] on 4 Dec 2006 06:11 "Lucian Wischik" <lu.nn(a)wischik.com> wrote in message news:95m6n25mpf1ea2psa0k8h6h6juqk00er9v(a)4ax.com... > mcheu <mpcheu(a)yahoo.com> wrote: >>One of the best kept secrets of windows (mostly because a lot of >>people don't believe you when you tell them) is that the icon files >>are just Windows BMP files with the extension changed to ICO. > > I don't believe you. > > A bitmap has only a single size and bitdepth. > > But a .ico file can contain multiple images, each of different size > and bitdepth. > > How would this be possible, if what you say is true? > > In any case, the MSDN documentation flat out contradicts you: > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_62uq.asp > > (What you might have observed is that some applications will work when > you give them a .bmp file instead of the .ico file that they normally > expect.) -- which includes Explorer. Explorer treats the (IIRC) top-left pixel color as transparent color, so you might not get the exact result you'd expect, but you can feed virtually *any* bmp into it and immediately see if it's okay to use as an icon. In most cases I don't even bother to change the image to a 'real' ico at all. [Jw]
From: Grzegorz Wróbel on 4 Dec 2006 10:11 [Jongware] wrote: > "Lucian Wischik" <lu.nn(a)wischik.com> wrote in message > news:95m6n25mpf1ea2psa0k8h6h6juqk00er9v(a)4ax.com... >> mcheu <mpcheu(a)yahoo.com> wrote: >>> One of the best kept secrets of windows (mostly because a lot of >>> people don't believe you when you tell them) is that the icon files >>> are just Windows BMP files with the extension changed to ICO. >> I don't believe you. >> >> A bitmap has only a single size and bitdepth. >> >> But a .ico file can contain multiple images, each of different size >> and bitdepth. >> >> How would this be possible, if what you say is true? >> >> In any case, the MSDN documentation flat out contradicts you: >> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp >> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_62uq.asp >> >> (What you might have observed is that some applications will work when >> you give them a .bmp file instead of the .ico file that they normally >> expect.) > > -- which includes Explorer. Explorer treats the (IIRC) top-left pixel color > as transparent color, so you might not get the exact result you'd expect, > but you can feed virtually *any* bmp into it and immediately see if it's > okay to use as an icon. In most cases I don't even bother to change the > image to a 'real' ico at all. I wondered how one could come to such silly idea that icon files are bmps. Indeed if you make 32bpp bitmap with alpha channel and rename it to .ico Explorer will render it correctly. It's not truth with opaque images. Real ico files consist of icon directory structure which can contain multiple images, the oldest format of each image are bmp file + 2 masks: xor and and. Alpha channel transparency is a newer thing not supported by older OSes and newest version of .ico files (for Vista and XP) supports png images as well. -- Grzegorz Wr�bel http://www.4neurons.com/ 677265676F727940346E6575726F6E732E636F6D
From: [Jongware] on 4 Dec 2006 10:51 "Grzegorz Wr�bel" </dev/null(a)localhost.localdomain> wrote in message news:el1dv6$mmu$1(a)atlantis.news.tpi.pl... > [Jongware] wrote: >> "Lucian Wischik" <lu.nn(a)wischik.com> wrote in message >> news:95m6n25mpf1ea2psa0k8h6h6juqk00er9v(a)4ax.com... >>> mcheu <mpcheu(a)yahoo.com> wrote: >>>> One of the best kept secrets of windows (mostly because a lot of >>>> people don't believe you when you tell them) is that the icon files >>>> are just Windows BMP files with the extension changed to ICO. >>> I don't believe you. >>> >>> A bitmap has only a single size and bitdepth. >>> >>> But a .ico file can contain multiple images, each of different size >>> and bitdepth. >>> >>> How would this be possible, if what you say is true? >>> >>> In any case, the MSDN documentation flat out contradicts you: >>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp >>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_62uq.asp >>> >>> (What you might have observed is that some applications will work when >>> you give them a .bmp file instead of the .ico file that they normally >>> expect.) >> >> -- which includes Explorer. Explorer treats the (IIRC) top-left pixel >> color as transparent color, so you might not get the exact result you'd >> expect, but you can feed virtually *any* bmp into it and immediately see >> if it's okay to use as an icon. In most cases I don't even bother to >> change the image to a 'real' ico at all. > > I wondered how one could come to such silly idea that icon files are bmps. > Indeed if you make 32bpp bitmap with alpha channel and rename it to .ico > Explorer will render it correctly. It's not truth with opaque images. Real > ico files consist of icon directory structure which can [???] How do you save this 32bpp bitmap? Surely not as a BMP file? 2nd: I just copied my background image (a frame grab from "2001") and renamed it to .ico. It *is* an 'opaque image' (the original being a BMP), and displays just fine as icon. > contain multiple images, the oldest format of each image are bmp file + 2 > masks: xor and and. Alpha channel transparency is a newer thing not > supported by older OSes and newest version of .ico files (for Vista and > XP) supports png images as well. That's new for me (the alpha stuff). My regular icon editor has *minimal* support for transparency, so I didn't bother. But the png support of XP is broken! A well-known fact among webmasters; whereas PNG supports virtually all possible combinations of x-bit image and y-bit alpha, Internet Explorer supports only a few. Would that finally be fixed in Vista? [Jw]
From: Grzegorz Wróbel on 4 Dec 2006 11:36 [Jongware] wrote: > [???] How do you save this 32bpp bitmap? Surely not as a BMP file? > 2nd: I just copied my background image (a frame grab from "2001") and > renamed it to .ico. It *is* an 'opaque image' (the original being a BMP), > and displays just fine as icon. > As bmp. I designed my own graphic format once, so I needed a converter from other format. I've chosen bmp for obvious reasons and implemented support for it little beyond the bmp 3.0 standard. Check out: http://www.4neurons.com/other/mbm/mbm.html There is also a pair of console utilities: png2bmp.exe and bmp2png.exe that can do this as well (convert a transparent png to 32bit bitmap with alpha channel). > That's new for me (the alpha stuff). My regular icon editor has *minimal* > support for transparency, so I didn't bother. > But the png support of XP is broken! A well-known fact among webmasters; > whereas PNG supports virtually all possible combinations of x-bit image and > y-bit alpha, Internet Explorer supports only a few. Would that finally be > fixed in Vista? It is working for icons (at least on XP SP2). As for proper 32bit png support in IE it has been added in IE 7.0 as far as I know. -- Grzegorz Wr�bel http://www.4neurons.com/ 677265676F727940346E6575726F6E732E636F6D
From: Grzegorz Wróbel on 4 Dec 2006 11:46 [Jongware] wrote: > "Grzegorz Wr�bel" </dev/null(a)localhost.localdomain> wrote in message >> Explorer will render it correctly. It's not truth with opaque images. Real ... > 2nd: I just copied my background image (a frame grab from "2001") and > renamed it to .ico. It *is* an 'opaque image' (the original being a BMP), > and displays just fine as icon. I meant there will be problems with setting 1bit transparency right. -- Grzegorz Wr�bel http://www.4neurons.com/ 677265676F727940346E6575726F6E732E636F6D
First
|
Prev
|
Pages: 1 2 Prev: catching HSHELL_GETMINRECT in shell hook Next: Loading Res... Error -- ERROR_RESOURCE_NAME_NOT_FOUND |