|
-
September 14th, 2010, 03:02 AM
#1
drawing a bitmap to the screen
hello,
im playing counter-strike 1.6 and the aiming cross hairs ( the X in the middle of the screen ) is not centered properly
so im trying to build a console application that would load a bitmap that i created and place it at the coordinates 512,384
here is what i have of the code untill now..
#include <windows.h>
#include <tchar.h>
int main()
{
HDC hdc = CreateCompatibleDC(NULL);
HBITMAP cross = (HBITMAP)LoadImage(NULL, _T("E:\\cross.bmp") ,IMAGE_BITMAP,0,0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
SelectObject(hdc, cross);
while (1)
{
HDC hdc_x = GetDC(HWND_DESKTOP);
BitBlt(hdc_x,488,359,48,48,hdc,0,0,LR_LOADFROMFILE);
ReleaseDC(HWND_DESKTOP,hdc_x);
}
return 0;
}
my problem with that, is that its not loading the image, and its showing me a black box and not the image
can somebody help me with this
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
|