Icons
Joe Krahn
jkrahn@nc.rr.com
Mon Aug 29 17:05:00 GMT 2005
Colin Harrison wrote:
> Hi,
>
> Tried your patch..I get no converted icons at all on my taskbar or X
> windows.
> In the right area though.
>
> If I force 16 iconSize in winXIconToHICON...background stripes on icons.
> If I force 32 iconSize in winXIconToHICON...works correctly (reported a few
> days ago)
> All run in multiwindow mode
> Earle's algorithms don't appear to work with anything other than 32, which
> is probably why iconSize was hard wired when he wrote them.
> I thought icons were DIB's and DWORD aligned?
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/
> msdn_icons.asp
>
> I'll extract my faulty/good converted icons to files and have a play.
> I'll also post some screen dumps on my website and call back (with and
> without various icon faults).
>
> Colin Harrison
>
>
Icons in resources and files are stored as DIBS, therefore 32-bit
aligned. When these are loaded into an HICON, they are converted to a
device-dependent bitmap, and are WORD aligned.
The usual method is to let Windows convert from DIB to DDB. However, the
multiwindow code creates a DDB directly using CreateBitmap(), rather
than CreateDIBitmap() or CreateDIBSection(). If X-Pixmap bit data is
packed the same as Win-Bitmap data, but with alignment differences, then
a packed-to-packed transfer is faster.
One possible source of the current problem is that WinXP changed how the
device-dependent data is stored, by adding an Alpha channel. (Are you
running XP?) This is mostly undocumented, because they assume everyone
creates DIB icons. So, the icon code should probably always unpack RGB
data into a DIB, and let Windows do the DDB conversion.
Now, I just need to figure out how to unpack the pixmap data. That can
also be tricky to get right, unless we can use RENDER extension routines
to do the work.
Joe
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/
More information about the Cygwin-xfree
mailing list