网站首页  词典首页

请输入您要查询的函数:

 

术语 stretchblt
释义 StretchBlt
语法:
BOOL StretchBlt(
__in HDC hdcDest,
__in int nXOriginDest,
__in int nYOriginDest,
__in int nWidthDest,
__in int nHeightDest,
__in HDC hdcSrc,
__in int nXOriginSrc,
__in int nYOriginSrc,
__in int nWidthSrc,
__in int nHeightSrc,
__in DWORD dwRop
);
StretchBlt函数
复制的StretchBlt函数从一个源矩形位图到目标矩形,拉伸或压缩位图,以适应目标矩形的尺寸,如有必要。该系统延伸或压缩根据伸缩模式目前在目标设备上下文设置位图。
参数
hdcDest [in]
句柄到目标设备上下文。
nXOriginDest [in]
的x坐标,按逻辑单位,对目标矩形左上角。
nYOriginDest [in]
在y坐标,按逻辑单位,对目标矩形左上角。
nWidthDest [in]
宽度,按逻辑单位,目标矩形。
nHeightDest [in]
的高度,以逻辑单位,目标矩形。
hdcSrc [in]
句柄到源设备上下文。
nXOriginSrc [in]
的x坐标,按逻辑单位,对源矩形的左上角。
nYOriginSrc [in]
在y坐标,按逻辑单位,对源矩形的左上角。
nWidthSrc [in]
宽度,按逻辑单位,源矩形。
nHeightSrc [in]
的高度,以逻辑单位,源矩形。
dwRop [in]
光栅要执行的操作。光栅操作码定义系统如何在输出操作相结合的颜色涉及刷,源位图和目标位图。
请参阅共同光栅操作码(专业人员应有)的列表BitBLT等。请注意,CAPTUREBLT人事登记,一般不能用于印刷设备上下文使用。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。
备注
StretchBlt延伸或压缩源位图在内存中,然后将结果复制目标矩形。此位图可以是兼容的位图(DDB),或从CreateDIBSection输出。模式或目标的像素颜色数据是合并后的拉伸或压缩发生。
当一个增强型图元文件已经被记录下来,出现错误(和函数返回FALSE)如果源设备环境标识一个增强型图元文件设备上下文。
如果指定的光栅操作需要一个刷,目前该系统使用到目标设备上下文选择了画笔。
目标坐标转换目前使用的目标设备环境中指定的转型;源坐标目前使用的源设备上下文指定的转型改造。
如果源变化有一个旋转或剪切,就会出现错误。
如果目的地,来源,以及位图模式不具有相同的颜色格式,StretchBlt转换为位图的源和模式匹配目标位。
如果StretchBlt必须将一个单色位图颜色位图,它设置白色位(1)背景色和黑色位(0)到前景色。颜色转换为位图一个单色位图,它设置像素相匹配的背景颜色为白色(1)及其他所有像素设置为黑色(0)。前台及彩色设备上下文背景颜色被使用。
StretchBlt创建位图镜像如果nWidthSrc和nWidthDest参数标志或者nHeightSrc和nHeightDest参数不同。如果nWidthSrc和nWidthDest有不同的标志,该函数创建一个沿x轴位图的镜像。如果nHeightSrc和nHeightDest有不同的标志,该函数创建一个沿y位镜像轴。
并非所有设备都支持StretchBlt功能。有关详细信息,请参见GetDeviceCaps。
ICM的:没有色彩管理时执行blit操作发生。
当用在多个监控系统,无论hdcSrc和hdcDest必须引用相同的设备或功能将失败。要为不同的设备转移,转换通过调用GetDIBits内存的DIB位图数据之间的区议会。要显示DIB的第二个设备,电话SetDIBits或StretchDIBits函数。
实例
有关示例,请参见缩放图像。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
位图概述
位图功能
BitBLT等
CreateDIBSection
GetDeviceCaps
GetDIBits
MaskBlt
PlgBlt
SetDIBits
SetStretchBltMode
StretchDIBits函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==StretchBlt Function
The StretchBlt function copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary. The system stretches or compresses the bitmap according to the stretching mode currently set in the destination device context.
Syntax
BOOL StretchBlt(
__in HDC hdcDest,
__in int nXOriginDest,
__in int nYOriginDest,
__in int nWidthDest,
__in int nHeightDest,
__in HDC hdcSrc,
__in int nXOriginSrc,
__in int nYOriginSrc,
__in int nWidthSrc,
__in int nHeightSrc,
__in DWORD dwRop
);
Parameters
hdcDest [in]
A handle to the destination device context.
nXOriginDest [in]
The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nYOriginDest [in]
The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nWidthDest [in]
The width, in logical units, of the destination rectangle.
nHeightDest [in]
The height, in logical units, of the destination rectangle.
hdcSrc [in]
A handle to the source device context.
nXOriginSrc [in]
The x-coordinate, in logical units, of the upper-left corner of the source rectangle.
nYOriginSrc [in]
The y-coordinate, in logical units, of the upper-left corner of the source rectangle.
nWidthSrc [in]
The width, in logical units, of the source rectangle.
nHeightSrc [in]
The height, in logical units, of the source rectangle.
dwRop [in]
The raster operation to be performed. Raster operation codes define how the system combines colors in output operations that involve a brush, a source bitmap, and a destination bitmap.
See BitBlt for a list of common raster operation codes (ROPs). Note that the CAPTUREBLT ROP generally cannot be used for printing device contexts.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
StretchBlt stretches or compresses the source bitmap in memory and then copies the result to the destination rectangle. This bitmap can be either a compatible bitmap (DDB) or the output from CreateDIBSection . The color data for pattern or destination pixels is merged after the stretching or compression occurs.
When an enhanced metafile is being recorded, an error occurs (and the function returns FALSE) if the source device context identifies an enhanced-metafile device context.
If the specified raster operation requires a brush, the system uses the brush currently selected into the destination device context.
The destination coordinates are transformed by using the transformation currently specified for the destination device context; the source coordinates are transformed by using the transformation currently specified for the source device context.
If the source transformation has a rotation or shear, an error occurs.
If destination, source, and pattern bitmaps do not have the same color format, StretchBlt converts the source and pattern bitmaps to match the destination bitmap.
If StretchBlt must convert a monochrome bitmap to a color bitmap, it sets white bits (1) to the background color and black bits (0) to the foreground color. To convert a color bitmap to a monochrome bitmap, it sets pixels that match the background color to white (1) and sets all other pixels to black (0). The foreground and background colors of the device context with color are used.
StretchBlt creates a mirror image of a bitmap if the signs of the nWidthSrc and nWidthDest parameters or if the nHeightSrc and nHeightDest parameters differ. If nWidthSrc and nWidthDest have different signs, the function creates a mirror image of the bitmap along the x-axis. If nHeightSrc and nHeightDest have different signs, the function creates a mirror image of the bitmap along the y-axis.
Not all devices support the StretchBlt function. For more information, see the GetDeviceCaps .
ICM: No color management is performed when a blit operation occurs.
When used in a multiple monitor system, both hdcSrc and hdcDest must refer to the same device or the function will fail. To transfer data between DCs for different devices, convert the memory bitmap to a DIB by calling GetDIBits . To display the DIB to the second device, call SetDIBits or StretchDIBits .
Examples
For an example, see Scaling an Image .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Bitmaps Overview
Bitmap Functions
BitBlt
CreateDIBSection
GetDeviceCaps
GetDIBits
MaskBlt
PlgBlt
SetDIBits
SetStretchBltMode
StretchDIBits
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd145120(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:24:44