Original Post
🔒 Locked
Bitmaps-How?
Advertisement
You need to learn Win32 API for Windows bitmap loading or make your own loader. Most of this is covered TOFTWGPG also Windows game programming for dummies has it. If you want to use Win32 API "Programming Windows with Win32 API" you can get it at Amazon.com for a nice price.
Go to Wotsit and get a description of the bitmap format. Then you have to display it on the screen, which is rather platform-dependant, so if you want us to tell you how to it, you're going to have to tell us what OS you're running.
If you're new to C++, then you shouldn't get in to graphics and stuff like that. Start with something a little bit easier.
- Muzzafarath
Mad House Software
The Field Marshals
Edited by - Muzzafarath on July 2, 2000 6:22:15 AM
If you're new to C++, then you shouldn't get in to graphics and stuff like that. Start with something a little bit easier.
- Muzzafarath
Mad House Software
The Field Marshals
Edited by - Muzzafarath on July 2, 2000 6:22:15 AM
Loading a bitmap is quite easy under Windows (if wrong platform then ignore all this crap). Do you want to put it on the screen in DirectX, or Windows GDI? Either way:
1) look up LoadImage() in the SDK, it will return a HBITMAP given a filename.
2) Use GetObject() to return a BITMAP which holds information about its bit depth, width and height, and the actual bitmap data. Look this one up as well.
3) Create a compatible DC (the hint is in the name), select the HBITMAP to that DC, and then use the DC to StretchBlt onto the DC of the target surface (be that a GDI surface or a DirectX surface).
Its a five to six step operation. look up LoadImage(), GetObject(), CreateCompatibleDC() i think, SelectObject() and StretchBlt(). Its all quite easy. Good luck, it sucks - I know. This stuff is all covered in the Win32 SDK (and don''t quote me against it, because its all off the top of my head!).
1) look up LoadImage() in the SDK, it will return a HBITMAP given a filename.
2) Use GetObject() to return a BITMAP which holds information about its bit depth, width and height, and the actual bitmap data. Look this one up as well.
3) Create a compatible DC (the hint is in the name), select the HBITMAP to that DC, and then use the DC to StretchBlt onto the DC of the target surface (be that a GDI surface or a DirectX surface).
Its a five to six step operation. look up LoadImage(), GetObject(), CreateCompatibleDC() i think, SelectObject() and StretchBlt(). Its all quite easy. Good luck, it sucks - I know. This stuff is all covered in the Win32 SDK (and don''t quote me against it, because its all off the top of my head!).
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement