Jump to content
  • Advertisement
Sign in to follow this  
programering

Using Win32 API

This topic is 4353 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Which are the standard for Win32 style coding for drawing bitmaps and pictures? My book "Windows Game Programming for Dummies" doesn't cover it in chapter 5 as it should. Is there two kinds to use? BITMAP and HBITMAP? To use HBITMAP I think one write: <code> HBITMAP hBmp = LoadBitmap(hInstance,MAKEINTRESOURCE(IDB_BITMAP_ID)); </code> Is HBITMAP used for bitmaps in resources? But how draw/blit it then I don't really know. Thanks. [Edited by - programering on October 18, 2006 10:05:29 PM]

Share this post


Link to post
Share on other sites
Advertisement
Just a hint - I tend to consider "for dummies" books to be crap just on general principles. if you google for LoadBitmap on the microsoft site you get all the information you need, probably a much better resource than the book. You sound as if you don't know if there is another type BITMAP. I would guess not, based on a quick skim-read of the above link(not really sure though).

Share this post


Link to post
Share on other sites
Thank you. rating++;

I've tried to search msdn for documentation, but never found any good.
But you've found that good documentation that I was looking for.
What did you search on? Edit: Ok. you searched for LoadBitmap

Share this post


Link to post
Share on other sites
Quote:
Original post by DaBookshah
General Tip: If you need info about win32 api method xxx, Google: site:microsoft.com xxx. Works every time.


Isn't that porn?

Share this post


Link to post
Share on other sites
See answer here of how to load and display a BMP file
http://support.microsoft.com/kb/q158898/
It's in french :), but cond don't lie...

Share this post


Link to post
Share on other sites
I need to load a bitmap from a FILE *pFile ptr, how todo that?
And how to blit it? The prototype for blitting takes a HDC.
BOOL BitBlt(
HDC hdcDest, // handle to destination DC
int nXDest, // x-coord of destination upper-left corner
int nYDest, // y-coord of destination upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXSrc, // x-coordinate of source upper-left corner
int nYSrc, // y-coordinate of source upper-left corner
DWORD dwRop // raster operation code
);
To convert it seems to be a bit complicated.

BTW, what the difference between BITMAP/HBITMAP and HDC?

The only image format that Win32 API seems to support is just *.bmp, why?

Share this post


Link to post
Share on other sites
Quote:
Original post by programering
I need to load a bitmap from a FILE *pFile ptr, how todo that?
And how to blit it? The prototype for blitting takes a HDC.
BOOL BitBlt(
HDC hdcDest, // handle to destination DC
int nXDest, // x-coord of destination upper-left corner
int nYDest, // y-coord of destination upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXSrc, // x-coordinate of source upper-left corner
int nYSrc, // y-coordinate of source upper-left corner
DWORD dwRop // raster operation code
);
To convert it seems to be a bit complicated.

BTW, what the difference between BITMAP/HBITMAP and HDC?

The only image format that Win32 API seems to support is just *.bmp, why?


because figuring out how to load other formats is generally pretty trivial. (i don't even understand why it has functions for loading .bmp)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!