|
-
Dec 24th, 2002, 02:17 PM
#1
Thread Starter
Frenzied Member
displaying bitmap on a static control
I've been looking at some API's recently, but haven't successfully been able to display a bitmap on a static control. Any ideas how to do it? my main goal is the easiest way possible to display an image
-
Dec 24th, 2002, 03:39 PM
#2
Thread Starter
Frenzied Member
im basically looking to load a bmp file without using resource files....LoadImage seems to be key, but I don't know where to go from there...can anyone help?
-
Dec 24th, 2002, 08:50 PM
#3
Lively Member
After load image you have to send the STM_SETIMAGE message to the control. The wParam should be IMAGE_BITMAP and the lParam should be the handle.
-
Dec 25th, 2002, 06:54 AM
#4
Code:
HBITMAP hbm = (HBITMAP)LoadImage(NULL, szFileName,
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if(hbm == NULL)
{
// error
}
// SS_BITMAP style must be set for the static control
SendMessage(hwndStatic, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hbm);
InvalidateRect(hwndStatic, NULL, TRUE);
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|