请问怎样将DIB中的某个矩形区域,绘制到HDC上?谢谢.
请问怎样将DIB中的某个矩形区域,绘制到HDC上?谢谢.
[解决办法]
int SetDIBitsToDevice(
HDC hdc, // handle to device context
int XDest, // x-coordinate of upper-left corner of
// dest. rect.
int YDest, // y-coordinate of upper-left corner of
// dest. rect.
DWORD dwWidth, // source rectangle width
DWORD dwHeight, // source rectangle height
int XSrc, // x-coordinate of lower-left corner of
// source rect.
int YSrc, // y-coordinate of lower-left corner of
// source rect.
UINT uStartScan, // first scan line in array
UINT cScanLines, // number of scan lines
CONST VOID *lpvBits, // address of array with DIB bits
CONST BITMAPINFO *lpbmi, // address of structure with bitmap info.
UINT fuColorUse // RGB or palette indexes
);
[解决办法]
我做过类似的,就是把图像中这个矩形块中的数据取出放到一个数组中,然后加上信息头和调色板,调用StretchDIBits()就可以了