Re: ImageList_GetImageInfo - alter the bitmap(s) ?

Newyana2 <[email protected]>
Newsgroups alt.comp.os.windows-xp,alt.windows7.general,comp.os.ms-windows.programmer.win32
Organization A noiseless patient Spider
Message-ID <[email protected]>
On 9/30/2024 3:11 PM, R.Wieser wrote:
> Hello all,
> 
> Using XPsp3.
> 
> I was playing with the idea to dynamically alter the contents of an
> ImageList, and found the
> https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-imagelist_getimageinfo
> function, which says :
> 
> "The information in this structure can be used to *directly* manipulate the
> bitmaps for the image"
> 
> (bolding mine).
> 
> I've been trying to think of how that is possible - the bitmaps cannot be
> selected into a memoryDC - and to google information about how that would
> work, but came up empty.
> 
> Question:
> Does anyone know what "directly manipulate the bitmaps" method MS is
> referring to in the above ?
> 
> Remark:
> I already thought of and written another way to do what I want, but would
> like to know how the above works.  Who knows, their (MS) method might be
> simpler. :-)
> 

   I've never used an ImageList, but the docs say GetImageInfo returns
an ImageInfo structure, which includes an hBitmap. With that you can
call things like GetDIBits, SetDIBits, etc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.