"Torn" images with BitBlt

Started by
11 comments, last by Orpheum 23 years, 7 months ago
Well I've looked though my win32 books and I'm afraid I can't help you that much. I was thinking though, I had a similar problem to yours (I'm using directx though, where I was loading bitmaps using gdi).

The process I think may help you is:

        HBITMAP hBitmap = (HBITMAP)LoadImage(NULL, FileName , IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE | LR_CREATEDIBSECTION);	//not sure on some of the flagsHDC BitmapDC = CreateCompatibleDC (NULL); SelectObject(BitmapDC, hBitmap); HDC WindowDC = GetDC (HWND hWindow);BitBlt(WindowDC, x, y, width, height, BitmapDC, 0, 0, SRCCOPY);ReleaseDC(WindowDC);    


NOTE:
I haven't tested this in any way/shape/form, it's based upon some code I wrote to load bitmaps to a directdraw surface, so no guarantees.

I felt bad 'coz hardly anyone seemed to have helped you on this, and I hope this helps.

- Jamie

[edit] fixed up dodgy source formatting
Waassaap!!

Edited by - mr_jrt on October 6, 2000 4:05:33 PM
Waassaap!!
Advertisement
Well I finally fixed this bitch - but the fix is unacceptable. This post is so damn unpopular that I will start a new thread for the discussion of another work around... Thanks to all those who contributed to this tho!!
There is no spoon.
You must use invalidaterect, to make the window repaint.

Put invalidate rect in your message loop.

So many ways of doing it....


While
{
if(Peekmessage)
{
}
invalidterect
}
Hardcore Until The End.

This topic is closed to new replies.

Advertisement