当前位置:网站首页>StretchDIBits函数
StretchDIBits函数
2022-07-02 16:58:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
引用:http://blog.csdn.net/giantchen547792075/article/details/6996011
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.
译:
StretchDIBits 函数把DIB、JPEG、PNG图像中一矩形区域内的像素颜色数据复制到指定的目标矩形里。如果目标矩形大于源矩形,此函数将拉伸的行和列以适合目标矩形的颜色数据。如果目标矩形小于源矩形,则此函数使用指定的光栅操作压缩的行和列。
语法:
int StretchDIBits (HDC hdc,int XDest,YDest,int int nDestWidth,int nDestHeight,int XSrc,int YSrc,int nSrcWidth,int nSrcHeight,const VOID __in * lpBits,__in const BITMAPINFO * lpBitsInfo,__in UINT iUsage,__in dword = dwRop) ;
参数:
hdc [入参]
目标设备上下文的句柄。
XDest [入参]
角点的 x 坐标,以逻辑单位的目标矩形的左上角。
YDest [入参]
Y 坐标,逻辑单位上的目标矩形的左上角。
nDestWidth [入参]
逻辑单位,目标矩形的宽度。
nDestHeight [入参]
逻辑单位,目标矩形的高度。
XSrc [入参]
角的 x 坐标,以像素为单位,源矩形图像中。
YSrc [入参]
Y 坐标,以像素为单位,源矩形图像中。
nSrcWidth [入参]
宽度,以像素为单位,源矩形图像中。
nSrcHeight [入参]
高度以像素为单位,源矩形图像中。
lpBits [入参]
图像的位,作为字节数组存储的指针。有关详细信息,请参见备注部分。
lpBitsInfo [入参]
指向包含DIB 相关信息的 BITMAPINFO 结构的指针。
iUsage [入参]
指定是否提供的 BITMAPINFO 结构的 bmiColors 成员,以及若然,是否 bmiColors 包含显式的红、 绿、 蓝 (RGB) 值或索引。IUsage 参数必须是下列值之一。
值 | 备注 |
---|---|
DIB_RGB_COLORS | 颜色表中包含文本的 RGB 值。 |
DIB_PAL_COLORS | 该数组包含到源设备上下文的逻辑调色板的 16 位索引。 |
dwRop [入参]
指定的方式组合在一起以形成新的图像源像素、 目标设备上下文的当前画刷和目标像素。有关详细信息,请参阅下面的备注部分。
返回值
如果函数成功,则返回值是扫描复制的行数。请注意,此值可以为负的镜像内容。
如果该函数失败,或者没有扫描行被复制,则返回值为 0。
如果驱动程序不支持 JPEG 或 PNG 文件图像传递给 StretchDIBits,该函数将失败并返回 GDI_ERROR。如果发生故障,应用程序必须依靠自己的 JPEG 或 PNG 支持,将图像的解压缩成位图,然后将该位图传递给 StretchDIBits。
备注
自底向上 DIB 的起始位置是左下角 ;自上而下 DIB 的起始位置是左上角。
StretchDIBits 创建一个位图镜的像图像,如果nSrcWidth 和 nDestWidth 这两个参数或 nSrcHeight 和 nDestHeight这两个参数的符号不同。NSrcWidth 和 nDestWidth 的符号不同,那么该函数创建一个沿 x 轴镜像的位图图像。NSrcHeight 和 nDestHeight 的符号不同,那么该函数创建沿 y 轴镜像的位图图像。
此函数允许 JPEG 或 PNG 图像作为源图像传入。每个参数如何使用仍保持不变,除非:
- 如果 BITMAPINFOHEADER 的 biCompression 成员是 BI_JPEG 或 BI_PNG,lpBits 指向包含 JPEG 或 PNG 图像单独的缓冲区。BITMAPINFOHEADER 结构的 biSizeImage 成员指定缓冲区的大小。IUsage 参数不得不被设置为 DIB_RGB_COLORS。DwRop 参数不得不被设置为 SRCCOPY。
- 为确保打印时有适当的图元文件缓存池,在调用 StretchDIBits 之前,应用程序必须调用 CHECKJPEGFORMAT 或 CHECKPNGFORMAT 转义以验证打印机可分别识别 JPEG 或 PNG 图像。
ICM: 如果通过使用 SetICMMode 的iEnableICM 参数设置为 ICM_ON的调用启用了色彩管理,那么颜色管理就会执行。如果由 lpBitsInfo 指定的位图有一指定伽马和成员终结点成员的BITMAPV4HEADER结构或一个指定 profileData 和 profileSize 的成员或伽马和成员终点结成员的 BITMAPV5HEADER 然后该位图的所有像素将被视为表达在由这些成员所述的色彩空间种而不是设备上下文的源颜色空间中。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/148419.html原文链接:https://javaforall.cn
边栏推荐
- Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
- Vi/vim delete: one line, one character, word, the first character of each line command
- Redis(6)----对象与数据结构
- Summary of fun free GM games
- 【Oracle 期末复习】表空间、表、约束、索引、视图的增删改
- 2020互联网行业术语
- Leetcode interview question 16.15 Abacus wonderful calculation
- Paddlepaddle 28 build an automatic coder based on convolution
- QT official example: QT quick controls - Gallery
- Explain kubernetes network model in detail
猜你喜欢
Wechat nucleic acid detection appointment applet system graduation design completion (4) opening report
微信核酸检测预约小程序系统毕业设计毕设(2)小程序功能
Qt官方示例:Qt Quick Controls - Gallery
微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
Leetcode 面试题 17.04. 消失的数字
一款简约PHP个人发卡程序V4.0版本
Leetcode interview question 16.11 Diving board
Pit encountered during installation of laravel frame
如何开启IDEA的Run Dashboard功能
Enter a valid user name and password in the Microsoft LDAP configuration page, and enter a valid user name in the Microsoft LDAP configuration page
随机推荐
Wechat nucleic acid detection appointment applet system graduation design completion (5) task statement
微信核酸检测预约小程序系统毕业设计毕设(4)开题报告
Babbitt | metauniverse daily must read: can you buy a virtual anchor for 1000 yuan? Is this the live gospel of small businesses or "cutting leeks"
微信小程序视频分享平台系统毕业设计毕设(6)开题答辩PPT
Pychar modify pep8 e501 line too long > 0 characters
Détends - toi encore! Ces nouveaux étudiants peuvent s'installer directement à Shanghai
QQmlApplicationEngine
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
vi/vim 删除:一行, 一个字符, 单词, 每行第一个字符 命令
iptable端口重定向 MASQUERADE[通俗易懂]
Unified interface for reading and writing data files in xml/json/ini and ubjson formats
Steamos 3.3 beta release, steam deck Chinese keyboard finally came
In early summer, Kaiyuan magic changed an electric mosquito racket with killing sound effect!
微信小程序视频分享平台系统毕业设计毕设(5)任务书
Iframe nesting details
UE4 draw a circle with spline
paddlepaddle 28 搭建基于卷积的自动编码机
Wechat applet video sharing platform system graduation design completion (7) Interim inspection report
Ue4 dessine un cercle avec une ligne de contour