loading and diplaying Graphics
I''m trying to program a starcraft tileset viewer.
I''ve loadet the pixeldata into an array and tryed to display the grafik with setpixel, but this is so slow!
How do i display graphics faster?
Well what language and API (DirectX / OpenGL / Win32) are you using ?
-------------Ban KalvinB !
You should probably look up BitBlt() which is used for displaying graphics in win32.
-------------Ban KalvinB !
I''ve tried this:
HBITMAP hbitmap;
BYTE buffer[50]={ 0, 0, 0, 0, 0,
0,255,255,255, 0,
0,255, 0, 0, 0,
0,255, 0, 0, 0,
0,255,255,255, 0,
0, 0, 0,255, 0,
0, 0, 0,255, 0,
0, 0, 0,255, 0,
0,255,255,255, 0,
0, 0, 0, 0, 0
}; // Image
hbitmap = CreateBitmap (5, 10, 1, 8, &buffer);
HDC hdc = GetDC(hwnd);
HDC image_dc = CreateCompatibleDC(hdc);
HBITMAP old_hbitmap = (HBITMAP)SelectObject(image_dc,hbitmap);
BitBlt(hdc,0,0,5,10,image_dc,0,0,SRCCOPY);
but it don''t display anything
HBITMAP hbitmap;
BYTE buffer[50]={ 0, 0, 0, 0, 0,
0,255,255,255, 0,
0,255, 0, 0, 0,
0,255, 0, 0, 0,
0,255,255,255, 0,
0, 0, 0,255, 0,
0, 0, 0,255, 0,
0, 0, 0,255, 0,
0,255,255,255, 0,
0, 0, 0, 0, 0
}; // Image
hbitmap = CreateBitmap (5, 10, 1, 8, &buffer);
HDC hdc = GetDC(hwnd);
HDC image_dc = CreateCompatibleDC(hdc);
HBITMAP old_hbitmap = (HBITMAP)SelectObject(image_dc,hbitmap);
BitBlt(hdc,0,0,5,10,image_dc,0,0,SRCCOPY);
but it don''t display anything
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement