这3个函数怎么用的?最后有例子说明。分不够可以再给。。。(30分)

  • 主题发起人 主题发起人 linqi07
  • 开始时间 开始时间
L

linqi07

Unregistered / Unconfirmed
GUEST, unregistred user!
CreateDIBSection(
SetDIBits(
bitBlt
 
BOOL BitBlt(

HDC hdcDest, // handle to destination device context
int nXDest, // x-coordinate of destination rectangle's upper-left corner
int nYDest, // y-coordinate of destination rectangle's upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source device context
int nXSrc, // x-coordinate of source rectangle's upper-left corner
int nYSrc, // y-coordinate of source rectangle's upper-left corner
DWORD dwRop // raster operation code
);
用天图像的复制

其它的两个好像是用于设定图像格式的
 
CreateDIBSection
The CreateDIBSection function creates a device-independent bitmap (DIB) that applications can write to directly. The function gives you a pointer to the location of the bitmap's bit values. You can supply a handle to a file mapping object that the function will use to create the bitmap, or you can let the system allocate the memory for the bitmap.

HBITMAP CreateDIBSection(
HDC hdc, // handle to device context
CONST BITMAPINFO *pbmi,
// pointer to structure containing bitmap size,
// format, and color data
UINT iUsage, // color data type indicator: RGB values or
// palette indexes
VOID *ppvBits, // pointer to variable to receive a pointer to
// the bitmap's bit values
HANDLE hSection, // optional handle to a file mapping object
DWORD dwOffset // offset to the bitmap bit values within the
// file mapping object
);


SetDIBits
The SetDIBits function sets the pixels in a bitmap using the color data found in the specified device-independent bitmap (DIB).

int SetDIBits(
HDC hdc, // handle to device context
HBITMAP hbmp, // handle to bitmap
UINT uStartScan, // starting scan line
UINT cScanLines, // number of scan lines
CONST VOID *lpvBits, // array of bitmap bits
CONST BITMAPINFO *lpbmi, // address of structure with bitmap data
UINT fuColorUse // type of color indexes to use
);


BitBlt
The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.

BOOL BitBlt(
HDC hdcDest, // handle to destination device context
int nXDest, // x-coordinate of destination rectangle's upper-left
// corner
int nYDest, // y-coordinate of destination rectangle's upper-left
// corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source device context
int nXSrc, // x-coordinate of source rectangle's upper-left
// corner
int nYSrc, // y-coordinate of source rectangle's upper-left
// corner
DWORD dwRop // raster operation code
);


 
多人接受答案了。
 
后退
顶部