SetStretchBltMode的用法

来源:互联网 发布:印度人怎么看种姓知乎 编辑:程序博客网 时间:2024/06/09 15:16
设置设备拷贝图片时的默认缩放模式
int SetStretchBltMode(  __in  HDC hdc,  __in  int iStretchMode);
hdc: 需要更改模式的DC句柄
iStretchMode:缩放模式
BLACKONWHITE

Performs a Boolean AND operation using the 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(与)操作运算。如果该位图是单色位图,那么该模式以牺牲白色像素为代价,保留黑色像素点。

COLORONCOLOR

Deletes the pixels. This mode deletes all eliminated lines of pixels without trying to preserve their information.

删除像素。该模式删除所有消除的像素行,不保留其信息。

HALFTONE

Maps pixels from the source rectangle into 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 function to set the brush origin. If it fails to do so, brush misalignment occurs.

将源矩形区中的像素映射到目标矩形区的像素块中,覆盖目标像素块的一般颜色与源像素的颜色接近。在设置完HALFTONE拉伸模之后,应用程序必须调用SetBrushOrgEx函数来设置刷子的起始点。如果没有成功,那么会出现刷子没对准的情况。

STRETCH_ANDSCANS

Same as BLACKONWHITE.

STRETCH_DELETESCANS

Same as COLORONCOLOR.

STRETCH_HALFTONE

Same as HALFTONE.

STRETCH_ORSCANS

Same as WHITEONBLACK.

WHITEONBLACK

Performs a Boolean OR operation using the 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(或)操作,如果该位图为单色位图,那么该模式以牺牲黑色像素为代价,保留白色像素点。

原创粉丝点击