PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: paulDiagnos on February 19, 2009, 12:38:01 PM

Title: Displaying resource bitmaps
Post by: paulDiagnos on February 19, 2009, 12:38:01 PM
Hi guys, me again

why doesnt the below code work :-(

ImageHandle = SendMessage( HWND_messagebox_Logo, %STM_GETIMAGE, %IMAGE_BITMAP, 0)
If ImageHandle Then DeleteObject ImageHandle
ImageHandle = LoadImage(App.hInstance,"21", %IMAGE_BITMAP,100, 100,0)       
SendMessage  HWND_messagebox_Logo, %STM_SETIMAGE, %IMAGE_BITMAP, ImageHandle   


the idea is that resource 21 is loaded directly and displayed , rather than my usual trick of extracting the bitmap then loading that. (long winded way i know )

below is the resource line.

21 RCDATA DISCARDABLE "..\images\question.bmp"   

for some reason the file just wont display in the picture window.

Paul.
Title: Re: Displaying resource bitmaps
Post by: TechSupport on February 19, 2009, 02:21:19 PM
Instead of "21" use "#21".

Instead of "RCDATA" use "BITMAP".

Make sure that the SS_BITMAP property is set in the "WindowStyles" property for the PictureBox.
Title: Re: Displaying resource bitmaps
Post by: paulDiagnos on February 20, 2009, 04:22:25 AM
christ.

I spent about 2 days before xmas trying to do an icon version of it, and eventually worked out the # thing!! grrr

oh well if I learned from my mistakes id pester you guys less.

thanks again Paul.
your a trooper.

Paul