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/
Blit Bitmaps (not in Direct X)
There''s no reason you couldn''t draw it pixel by pixel.
Mike
Mike
"Unintentional death of one civilian by the US is a tragedy; intentional slaughter of a million by Saddam - a statistic." - Unknown
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().
Well thanks, but lets just pretend i''ve never ever tried to blit anything onto a bitmap... can you point me to a tutorial??? THANKS
- king171@hotmail.com
- http://www.cfxweb.net/mxf/
- king171@hotmail.com
- http://www.cfxweb.net/mxf/
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);
}
};
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);
}
};
-------------------------------NeXe: NeHe DirectX-style. Follow the orange rabbit.
Read MSDN Platform SDK->GDI->Using Bitmaps, and look into GDI sample programs with MSDN
-kertropp
-kertropp
-kertropp C:Projectsrg_clueph_opt.c(185) : error C3142: 'PushAll' :bad ideaC:Projectsrg_clueph_opt.c(207) : error C324: 'TryCnt': missing point
MSDN Library Home
Search MSDN Library
MSDN DirectX Developer Center
*Sparkle*
Edited by - Sparkle on 3/14/00 12:29:40 PM
Search MSDN Library
MSDN DirectX Developer Center
*Sparkle*
Edited by - Sparkle on 3/14/00 12:29:40 PM
March 14, 2000 01:03 PM
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
there is a good tutorial
Mike Street
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/
- king171@hotmail.com
- http://www.cfxweb.net/mxf/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement