in case you need more speed (for animations or if the user
is allowed to zoom in realtime) use DrawDibDraw instead:
Code:
BOOL DrawDibDraw(
HDRAWDIB hdd,
HDC hdc,
int xDst,
int yDst,
int dxDst,
int dyDst,
LPBITMAPINFOHEADER lpbi,
LPVOID lpBits,
int xSrc,
int ySrc,
int dxSrc,
int dySrc,
UINT wFlags
);
this function belongs to Video for Windows.
all you got to do is change your bitmap data from top-down-RGB
to bottom-up-BGR and add the DrawDibOpen and DrawDibClose calls.
example wndproc could look like this:
WM_CREATE:
Code:
hdib = DrawDibOpen();
WM_PAINT:
Code:
HDC hdc = GetDC( hwnd );
DrawDibDraw( hdib, hdc, ... );
ReleaseDC( hwnd, hdc );
WM_DESTROY:
Code:
DrawDibClose( hdib );
DrawDib at MSDN:
http://msdn.microsoft.com/library/de...ng_drawdib.asp