well the obvious question is when are you calling it? You should NEVER use BeginPaint outside of the WM_PAINT case statement. You can use GetDC or GetDCEx for this.

Just curious but why scale the bitmap creating another object to delete? Just use select the original image into your memory dc and use StretchBlt. (make sure to call SetStretchBltMode otherwise the quality might suffer).

And you may want to check the returned value from your function. I cant really tell if the returned bitmap handles are valid or did the load fail etc..

also if your using LoadImage internally (or another win api) try using GetLastError to see if an error occured in those calls.

Also make sure the path is a fully qualified path. If the image is not within the same directory as the executable then you cant use "image.bmp" alone.

one last thing. it would probably be easier to just register a window class and use it instead of a static. this way you can do your paint directly in its WM_PAINT msg w/o the need to subclass. You dont add any overhead since your already using a child control it would just be a different one.

Last edited by Narusegawa_Naru; 24/01/05 04:18 AM.

Have Fun smile