Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

King

Blit Bitmaps (not in Direct X)

This topic is 6647 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

I was wonder what the best way to blit a bitmap onto a window is. I want to blit a bitmap on the window and be able to put it anywhere i want, and in windows functions not directX. Is there any sites or tutorials you can direct me to? thanks for the help. P.S. MXF Entertainment has a demo out right now, go download it and give us comments. - king171@hotmail.com
- http://www.cfxweb.net/mxf/

Share this post


Link to post
Share on other sites
Advertisement
The GDI is pretty good at blitting, it''s not as fast as DDraw but it does the job. The function you should be looking for is BitBlt().

Share this post


Link to post
Share on other sites
Here''s a friendly little structure I wrote a while back to handle the misery of blitting something with windows...
struct SpriteMap {
HBITMAP Picture;
int x;
int y;
int width;
int height;
void LoadBitmap(char *FileName){
Picture=LoadImage(NULL,FileName , IMAGE_BITMAP, width, height,LR_LOADFROMFILE);
}
void Draw() {
HDC hdcDrawOn;
HDC hdcImage = CreateCompatibleDC(NULL);
SelectObject(hdcImage, Picture);
hdcDrawOn=GetDC(main_window_handle);
BitBlt(hdcDrawOn, x, y, width, height, hdcImage, 0, 0, SRCCOPY);
ReleaseDC(main_window_handle,hdcDrawOn);
DeleteObject(hdcImage);

}

};

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
King, if you want to learn about blitting, check this url http://www.geocities.com/SiliconValley/Park/3269/
there is a good tutorial

Mike Street

Share this post


Link to post
Share on other sites
Thanks everyone, but i''m looking for a website which has a tutorial specifically on blitting images on the screen and using em. Thanks unknown person, but i''m a C++ programmer i should have made that clear. Please keep em coming though because i haven''t found what i want yet. Thanks again.

- king171@hotmail.com
- http://www.cfxweb.net/mxf/

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!