Bitmap in CStatic is not redrawn

"mattgreenrocks" <mattgreenrocks-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
I'm writing a media player using WTL, and I've encountered a problem. An image contained in a CStatic control ends up disappearing after either resizing, or minimizing/maximizing the application.

When the user starts to play an audio file, it looks for the accompanying album art. If it is found, I use GDI+ to scale the image down nicely, saving the resulting Gdiplus::Bitmap* to a member variable (read: keeping it in scope). Then, I call GetHBITMAP(), and pass that to CStatic::SetBitmap(). The image shows up on the main dialog, and life is good...until it needs to be redrawn. Then, it just disappears completely. I tried adding the redraw flag to my CDialogResize map, but it didn't seem to fix it.

Is my HBITMAP no longer valid after a redraw of the area takes place? If I go to another track, then the art for the second track shows up fine.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
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.