网站首页  词典首页

请输入您要查询的函数:

 

术语 stretchdibits
释义 StretchDIBits
语法:
int StretchDIBits(
__in HDC hdc,
__in int XDest,
__in int YDest,
__in int nDestWidth,
__in int nDestHeight,
__in int XSrc,
__in int YSrc,
__in int nSrcWidth,
__in int nSrcHeight,
__in const VOID *lpBits,
__in const BITMAPINFO *lpBitsInfo,
__in UINT iUsage,
__in DWORD dwRop
);
StretchDIBits函数功能
复制的StretchDIBits函数的一个像素的DIB,JPEG或PNG图像矩形到指定目标矩形的颜色数据。如果目标矩形比源矩形大,此功能延伸的行和列的颜色数据,以适应目标矩形。如果目标矩形比源矩形小,此功能通过使用压缩指定光栅操作行和列。
参数
hdc [in]
句柄到目标设备上下文。
XDest [in]
的x坐标,按逻辑单位,对目标矩形左上角。
YDest [in]
在y坐标,按逻辑单位,对目标矩形左上角。
nDestWidth [in]
宽度,按逻辑单位,目标矩形。
nDestHeight [in]
的高度,以逻辑单位,目标矩形。
XSrc [in]
的x坐标,以像素,在图像的源矩形。
YSrc [in]
在y坐标,以像素,在图像的源矩形。
nSrcWidth [in]
的宽度,以像素为单位的图像源矩形。
nSrcHeight [in]
的高度,以像素为单位的图像源矩形。
lpBits [in]
阿位的形象,这是作为一个字节数组存储的指针。有关详细信息,请参见备注部分。
lpBitsInfo [in]
一个BITMAPINFO结构,它包含有关DIB信息的指针。
iUsage [in]
指定是否BITMAPINFO结构的成员bmiColors提供了,如果有的话,是否包含了明确的bmiColors红,绿,蓝(RGB)值或索引。该iUsage参数必须是下列值之一。
ValueMeaning
DIB_PAL_COLORSThe数组包含到源设备环境的逻辑调色板的16位索引。
DIB_RGB_COLORSThe颜色表包含文字RGB值。
有关详细信息,请参见备注部分。
dwRop [in]
指定如何源像素,目标设备上下文的当前画笔,和目标像素被合并为新的形象。有关详细信息,请参阅下面的备注部分。
返回值
如果函数成功,返回值是复制的扫描线数。
如果函数失败,返回值是GDI_ERROR。
如果驱动程序不能支持JPEG或PNG文件的图像传递到StretchDIBits函数,该函数将失败并返回GDI_ERROR。如果确实发生故障,应用程序必须回到自己的JPEG或PNG支持解压缩到一个位图图像,然后通过位图StretchDIBits函数。
备注
在自下而上的起源了DIB是在左下角,一个自上而下的DIB的原产地是左上角。
StretchDIBits函数创建位图镜像如果nSrcWidth和nDestWidth参数,或者如果nSrcHeight和nDestHeight参数不同的迹象。如nSrcWidth和nDestWidth有不同的标志,该函数创建一个沿x轴位图的镜像。如果nSrcHeight和nDestHeight有不同的标志,该函数创建一个沿y位镜像轴。
该功能允许JPEG或PNG图像作为源图像通过。每次的参数是用来保持不变,除非:
如果位图信息biCompression成员BI_JPEG或BI_PNG,lpBits指向一个缓冲区包含JPEG或PNG图像,分别。该BITMAPINFOHEADER结构biSizeImage成员指定缓冲区的大小。该iUsage参数必须设置为DIB_RGB_COLORS。该dwRop参数必须设置为SRCCOPY。
为了确保在适当的图元文件后台打印,应用程序必须调用CHECKJPEGFORMAT或CHECKPNGFORMAT逃避验证打印机承认在调用StretchDIBits函数的JPEG或PNG图像分别。
ICM的:色彩管理是执行,如果色彩管理已与调用SetICMMode设置为ICM_ON的iEnableICM参数启用。如果lpBitsInfo指定的位图有一个BITMAPV4HEADER,指定伽马和终端的成员,或指定任何BITMAPV5HEADERγ和端点的成员或profileData和profileSize成员,然后按通话视为是在色彩空间描述表示,位图的像素这些成员,而不是在设备方面的源色彩空间。
实例
有关示例,请参见施胶JPEG或PNG图像。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
位图概述
位图功能
SetMapMode
SetStretchBltMode
BITMAPINFO
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==StretchDIBits Function
The StretchDIBits function copies the color data for a rectangle of pixels in a DIB, JPEG, or PNG image to the specified destination rectangle. If the destination rectangle is larger than the source rectangle, this function stretches the rows and columns of color data to fit the destination rectangle. If the destination rectangle is smaller than the source rectangle, this function compresses the rows and columns by using the specified raster operation.
Syntax
int StretchDIBits(
__in HDC hdc,
__in int XDest,
__in int YDest,
__in int nDestWidth,
__in int nDestHeight,
__in int XSrc,
__in int YSrc,
__in int nSrcWidth,
__in int nSrcHeight,
__in const VOID *lpBits,
__in const BITMAPINFO *lpBitsInfo,
__in UINT iUsage,
__in DWORD dwRop
);
Parameters
hdc [in]
A handle to the destination device context.
XDest [in]
The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
YDest [in]
The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nDestWidth [in]
The width, in logical units, of the destination rectangle.
nDestHeight [in]
The height, in logical units, of the destination rectangle.
XSrc [in]
The x-coordinate, in pixels, of the source rectangle in the image.
YSrc [in]
The y-coordinate, in pixels, of the source rectangle in the image.
nSrcWidth [in]
The width, in pixels, of the source rectangle in the image.
nSrcHeight [in]
The height, in pixels, of the source rectangle in the image.
lpBits [in]
A pointer to the image bits, which are stored as an array of bytes. For more information, see the Remarks section.
lpBitsInfo [in]
A pointer to a BITMAPINFO structure that contains information about the DIB.
iUsage [in]
Specifies whether the bmiColors member of the BITMAPINFO structure was provided and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or indexes. The iUsage parameter must be one of the following values.
ValueMeaning
DIB_PAL_COLORSThe array contains 16-bit indexes into the logical palette of the source device context.
DIB_RGB_COLORSThe color table contains literal RGB values.

For more information, see the Remarks section.
dwRop [in]
Specifies how the source pixels, the destination device context's current brush, and the destination pixels are to be combined to form the new image. For more information, see the following Remarks section.
Return Value
If the function succeeds, the return value is the number of scan lines copied.
If the function fails, the return value is GDI_ERROR.
If the driver cannot support the JPEG or PNG file image passed to StretchDIBits, the function will fail and return GDI_ERROR. If failure does occur, the application must fall back on its own JPEG or PNG support to decompress the image into a bitmap, and then pass the bitmap to StretchDIBits.
Remarks
The origin of a bottom-up DIB is the bottom-left corner; the origin of a top-down DIB is the upper-left corner.
StretchDIBits creates a mirror image of a bitmap if the signs of the nSrcWidth and nDestWidth parameters, or if the nSrcHeight and nDestHeight parameters differ. If nSrcWidth and nDestWidth have different signs, the function creates a mirror image of the bitmap along the x-axis. If nSrcHeight and nDestHeight have different signs, the function creates a mirror image of the bitmap along the y-axis.
This function allows a JPEG or PNG image to be passed as the source image. How each parameter is used remains the same, except:
If the biCompression member of BITMAPINFOHEADER is BI_JPEG or BI_PNG, lpBits points to a buffer containing a JPEG or PNG image, respectively. The biSizeImage member of the BITMAPINFOHEADER structure specifies the size of the buffer. The iUsage parameter must be set to DIB_RGB_COLORS. The dwRop parameter must be set to SRCCOPY.
To ensure proper metafile spooling while printing, applications must call the CHECKJPEGFORMAT or CHECKPNGFORMAT escape to verify that the printer recognizes the JPEG or PNG image, respectively, before calling StretchDIBits.
ICM: Color management is performed if color management has been enabled with a call to SetICMMode with the iEnableICM parameter set to ICM_ON. If the bitmap specified by lpBitsInfo has a BITMAPV4HEADER that specifies the gamma and endpoints members, or a BITMAPV5HEADER that specifies either the gamma and endpoints members or the profileData and profileSize members, then the call treats the bitmap's pixels as being expressed in the color space described by those members, rather than in the device context's source color space.
Examples
For an example, see Sizing a JPEG or PNG 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
SetMapMode
SetStretchBltMode
BITMAPINFO
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd145121(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:18:03