?? dib_draw.h
字號:
#ifndef _DIB_DRAW_H
#define _DIB_DRAW_H
#include "vfw.h"
#pragma comment(lib,"vfw32.lib")
/// DrawDibXXX函數(shù)族封裝類.
class dib_draw
{
HDRAWDIB handle; // handle
CWnd *o; // owner
BITMAPINFOHEADER bih;
public:
dib_draw():handle(NULL), o(NULL){}
~dib_draw(){destroy();}
bool create(CWnd* owner, int w, int h, DWORD fourcc, int bitcount)
{
o = owner;
ZeroMemory(&bih, sizeof(bih));
bih.biSize = sizeof(bih);
bih.biBitCount = bitcount;
bih.biCompression = fourcc;
bih.biWidth = w;
bih.biHeight = h;
bih.biPlanes = 1;
handle = DrawDibOpen();
return handle != NULL;
}
void destroy()
{
if( handle )
{
DrawDibClose(handle);
handle = NULL;
}
o = NULL;
}
void draw(void* buf)
{
if( !handle || !o ) return;
CClientDC dc(o);
CRect rc;
o->GetClientRect(rc);
draw(buf, &dc, rc);
}
void draw(void* buf, CDC* pdc, CRect rc)
{
DrawDibDraw(handle, pdc->m_hDC, rc.left, rc.top, rc.Width(), rc.Height(),
&bih, buf,
0, 0, bih.biWidth, bih.biHeight,
SRCCOPY);
}
};
#endif // _DIB_DRAW_H
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -