网站首页  词典首页

请输入您要查询的函数:

 

术语 setdibitstodevice
释义 SetDIBitsToDevice
语法:
int SetDIBitsToDevice(
__in HDC hdc,
__in int XDest,
__in int YDest,
__in DWORD dwWidth,
__in DWORD dwHeight,
__in int XSrc,
__in int YSrc,
__in UINT uStartScan,
__in UINT cScanLines,
__in const VOID *lpvBits,
__in const BITMAPINFO *lpbmi,
__in UINT fuColorUse
);
SetDIBitsToDevice函数
该SetDIBitsToDevice函数设置在关于是与目标设备利用的DIB,JPEG或PNG图像色彩数据上下文关联的设备指定矩形的像素。
参数
hdc [in]
一个句柄,设备上下文。
XDest [in]
的x坐标,按逻辑单位,对目标矩形左上角。
YDest [in]
在y坐标,按逻辑单位,对目标矩形左上角。
dwWidth [in]
宽度,按逻辑单位的形象。
dwHeight [in]
的高度,以逻辑单位的形象。
XSrc [in]
的x坐标,按逻辑单位,对图像的左下角。
YSrc [in]
在y坐标,按逻辑单位,对图像的左下角。
uStartScan [in]
在开始扫描图像中的行。
cScanLines [in]
在DIB的扫描包含在数组中的行数指向lpvBits参数。
lpvBits [in]
一个颜色数据的指针存储为一个字节数组。有关详细信息,请参阅下面的备注部分。
lpbmi [in]
一个BITMAPINFO结构,它包含有关DIB信息的指针。
fuColorUse [in]
指示是否BITMAPINFO结构的成员bmiColors包含了明确的红,绿,蓝(RGB)值或索引到调色板。有关详细信息,请参阅下面的备注部分。
该fuColorUse参数必须是下列值之一。
ValueMeaning
DIB_PAL_COLORSThe颜色表由一组16进入当前选定的逻辑调色板位索引。
DIB_RGB_COLORSThe颜色表包含文字RGB值。
返回值
如果函数成功,返回值是一套扫描线数。
如果为零扫描线设置(例如,当dwHeight为0)或函数失败,函数返回零。
如果驱动程序不能支持JPEG或PNG文件图像传递给SetDIBitsToDevice,该函数将失败并返回GDI_ERROR。如果确实发生故障,应用程序必须回到自己的JPEG或PNG支持解压缩到一个位图图像,然后通过位图SetDIBitsToDevice。
备注
优化位图绘制时获得的速度是位图位已经进入系统调色板索引。
应用程序可以通过调用函数的GetSystemPaletteEntries系统调色板颜色和索引。之后,颜色和索引检索,应用程序可以创建的DIB。如需有关系统调色板信息,请参阅颜色。
扫描必须遵循的一个DWORD除了游程压缩位图线。
在自下而上的起源了DIB是左下角位图的角落,一个自上而下的DIB的原产地是左上角。
为了减少所需内存量设置从设备上的一个大表面DIB位,应用程序可以通过重复调用带SetDIBitsToDevice输出,放置到lpvBits数组位图的不同部分的每一次。在uStartScan和cScanLines参数的值确定在lpvBits数组中的位图的一部分。
该SetDIBitsToDevice函数返回一个,如果它是由一个进程,在后台运行,而一个全屏幕MS - DOS会话称为误差在前台运行。
如果位图信息biCompression成员BI_JPEG或BI_PNG,lpvBits指向一个缓冲区包含JPEG或PNG图像。在biSizeImage成员指定缓冲区的大小。 The fuColorUse parameter must be set to DIB_RGB_COLORS.
为了确保在适当的图元文件后台打印,应用程序必须调用CHECKJPEGFORMAT或CHECKPNGFORMAT逃避验证打印机承认在调用SetDIBitsToDevice的JPEG或PNG图像分别。
ICM的:色彩管理是执行,如果色彩管理已与调用SetICMMode设置为ICM_ON的iEnableICM参数启用。如果lpbmi有BITMAPV4HEADER,指定伽马和终端的成员,或指定任何BITMAPV5HEADERγ和端点的成员或profileData和profileSize的成员,那么调用中指定的位图视为是在色彩空间描述表示,位图的像素这些成员,而不是在设备方面的源色彩空间。
实例
有关示例,请参见测试JPEG或PNG支持打印机。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
位图概述
位图功能
BITMAPINFO
GetSystemPaletteEntries
SetDIBits
StretchDIBits函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SetDIBitsToDevice Function
The SetDIBitsToDevice function sets the pixels in the specified rectangle on the device that is associated with the destination device context using color data from a DIB, JPEG, or PNG image.
Syntax
int SetDIBitsToDevice(
__in HDC hdc,
__in int XDest,
__in int YDest,
__in DWORD dwWidth,
__in DWORD dwHeight,
__in int XSrc,
__in int YSrc,
__in UINT uStartScan,
__in UINT cScanLines,
__in const VOID *lpvBits,
__in const BITMAPINFO *lpbmi,
__in UINT fuColorUse
);
Parameters
hdc [in]
A handle to the 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.
dwWidth [in]
The width, in logical units, of the image.
dwHeight [in]
The height, in logical units, of the image.
XSrc [in]
The x-coordinate, in logical units, of the lower-left corner of the image.
YSrc [in]
The y-coordinate, in logical units, of the lower-left corner of the image.
uStartScan [in]
The starting scan line in the image.
cScanLines [in]
The number of DIB scan lines contained in the array pointed to by the lpvBits parameter.
lpvBits [in]
A pointer to the color data stored as an array of bytes. For more information, see the following Remarks section.
lpbmi [in]
A pointer to a BITMAPINFO structure that contains information about the DIB.
fuColorUse [in]
Indicates whether the bmiColors member of the BITMAPINFO structure contains explicit red, green, blue (RGB) values or indexes into a palette. For more information, see the following Remarks section.
The fuColorUse parameter must be one of the following values.
ValueMeaning
DIB_PAL_COLORSThe color table consists of an array of 16-bit indexes into the currently selected logical palette.
DIB_RGB_COLORSThe color table contains literal RGB values.

Return Value
If the function succeeds, the return value is the number of scan lines set.
If zero scan lines are set (such as when dwHeight is 0) or the function fails, the function returns zero.
If the driver cannot support the JPEG or PNG file image passed to SetDIBitsToDevice, 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 SetDIBitsToDevice.
Remarks
Optimal bitmap drawing speed is obtained when the bitmap bits are indexes into the system palette.
Applications can retrieve the system palette colors and indexes by calling the GetSystemPaletteEntries function. After the colors and indexes are retrieved, the application can create the DIB. For more information about the system palette, see Colors .
The scan lines must be aligned on a DWORD except for RLE-compressed bitmaps.
The origin of a bottom-up DIB is the lower-left corner of the bitmap; the origin of a top-down DIB is the upper-left corner.
To reduce the amount of memory required to set bits from a large DIB on a device surface, an application can band the output by repeatedly calling SetDIBitsToDevice, placing a different portion of the bitmap into the lpvBits array each time. The values of the uStartScan and cScanLines parameters identify the portion of the bitmap contained in the lpvBits array.
The SetDIBitsToDevice function returns an error if it is called by a process that is running in the background while a full-screen MS-DOS session runs in the foreground.
If the biCompression member of BITMAPINFOHEADER is BI_JPEG or BI_PNG, lpvBits points to a buffer containing a JPEG or PNG image. The biSizeImage member of specifies the size of the buffer. The fuColorUse parameter must be set to DIB_RGB_COLORS.
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 SetDIBitsToDevice.
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 lpbmi 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 Testing a Printer for JPEG or PNG Support .
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
BITMAPINFO
GetSystemPaletteEntries
SetDIBits
StretchDIBits
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162974(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:26:31