您的位置:首页 > 其它

SetStretchBltMode的用法

2013-02-20 12:08 453 查看
设置设备拷贝图片时的默认缩放模式
int SetStretchBltMode(__in  HDC hdc,__in  int iStretchMode);
hdc: 		需要更改模式的DC句柄
iStretchMode:	缩放模式
BLACKONWHITEPerforms a Boolean AND operation usingthe color values for the eliminated and existing pixels. If the bitmap is a monochrome bitmap, this mode preserves black pixels at the expense of white pixels.使用消除和现在的像素颜色值进行逻辑AND(与)操作运算。如果该位图是单色位图,那么该模式以牺牲白色像素为代价,保留黑色像素点。
COLORONCOLORDeletes the pixels. This mode deletesall eliminated lines of pixels without trying to preserve their information.删除像素。该模式删除所有消除的像素行,不保留其信息。
HALFTONEMaps pixels from the source rectangleinto blocks of pixels in the destination rectangle. The average color over the destination block of pixels approximates the color of the source pixels.After setting the HALFTONE stretching mode,an application must call the SetBrushOrgEx functionto set the brush origin. If it fails to do so, brush misalignment occurs.将源矩形区中的像素映射到目标矩形区的像素块中,覆盖目标像素块的一般颜色与源像素的颜色接近。在设置完HALFTONE拉伸模之后,应用程序必须调用SetBrushOrgEx函数来设置刷子的起始点。如果没有成功,那么会出现刷子没对准的情况。
STRETCH_ANDSCANSSame as BLACKONWHITE.
STRETCH_DELETESCANSSame as COLORONCOLOR.
STRETCH_HALFTONESame as HALFTONE.
STRETCH_ORSCANSSame as WHITEONBLACK.
WHITEONBLACKPerforms a Boolean OR operation usingthe color values for the eliminated and existing pixels. If the bitmap is a monochrome bitmap, this mode preserves white pixels at the expense of black pixels.使用颜色值进行逻辑OR(或)操作,如果该位图为单色位图,那么该模式以牺牲黑色像素为代价,保留白色像素点。
[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: