Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting a bitmap from an imagelist

3 views
Skip to first unread message

Jean

unread,
Nov 15, 2009, 5:50:04 AM11/15/09
to
Hello
I want to get an image from my imagelist then i want to copy it with a
different size to another imagelist.
I create a HDC, then i use ImageList_Draw to draw the desired image to this
HDC.
Then i creare a HBITMAP with CreateCompatibleBitmap
I create a compatible HDC, i select the HBITMAP from HDC in this compatible
HDC then i StretchBlt from the HDC to the compatible DC.

Then i try to add the HBITMAP to a new list but i can't, the bitmap is all
black.
If i save the HBITMAP to disk then load it the image is OK

???????

Help !!

Jean


Christian ASTOR

unread,
Nov 15, 2009, 7:21:52 AM11/15/09
to

You must also draw the bitmap mask (ILD_MASK), then CopyImage() for
example to resize the 2 bitmaps for ImageList_Add()

Jean

unread,
Nov 15, 2009, 7:59:27 AM11/15/09
to
> You must also draw the bitmap mask (ILD_MASK), then CopyImage() for
> example to resize the 2 bitmaps for ImageList_Add()

even if there is no mask ?

Jean
"Christian ASTOR" <cast...@club-internet.fr> a �crit dans le message de
news: 05776284-900a-4e21...@b15g2000yqd.googlegroups.com...

Christian ASTOR

unread,
Nov 15, 2009, 2:46:44 PM11/15/09
to
On 15 nov, 13:59, "Jean" <sl...@slash.fr> wrote:
> > You must also draw the bitmap mask (ILD_MASK), then CopyImage() for
> > example to resize the 2 bitmaps for ImageList_Add()
>
> even if there is no mask ?

No, but you can't add a bitmap to an ImageList while it's selected on
a DC. That's why you should use CopyImage() .

Jean

unread,
Nov 18, 2009, 11:31:58 PM11/18/09
to
Thanks, it works :-)

Jean
"Christian ASTOR" <cast...@club-internet.fr> a �crit dans le message de

news: fd92d3c7-d7ef-4ad8...@a32g2000yqm.googlegroups.com...

0 new messages