当前位置:网站首页>Stretchdibits function
Stretchdibits function
2022-07-02 18:32:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
quote :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.
translate :
StretchDIBits Function DIB、JPEG、PNG The pixel color data in a rectangular area of the image is copied to the specified target rectangle . If the destination rectangle is larger than the source rectangle , This function stretches the rows and columns to fit the color data of the target rectangle . If the destination rectangle is smaller than the source rectangle , Then this function uses the specified raster operation to compress rows and columns .
grammar :
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) ;
Parameters :
hdc [ Enter the reference ]
Handle to the target device context .
XDest [ Enter the reference ]
Corner x coordinate , The upper left corner of the destination rectangle in logical units .
YDest [ Enter the reference ]
Y coordinate , The upper left corner of the target rectangle on the logical unit .
nDestWidth [ Enter the reference ]
Logical unit , The width of the target rectangle .
nDestHeight [ Enter the reference ]
Logical unit , The height of the target rectangle .
XSrc [ Enter the reference ]
Angular x coordinate , In pixels , Source rectangle image .
YSrc [ Enter the reference ]
Y coordinate , In pixels , Source rectangle image .
nSrcWidth [ Enter the reference ]
Width , In pixels , Source rectangle image .
nSrcHeight [ Enter the reference ]
The height is in pixels , Source rectangle image .
lpBits [ Enter the reference ]
Bit of image , Pointer stored as a byte array . For more information , Please refer to the remarks section .
lpBitsInfo [ Enter the reference ]
Directional inclusion DIB Related information BITMAPINFO Pointer to structure .
iUsage [ Enter the reference ]
Specify whether to provide BITMAPINFO Structural bmiColors member , And if so , whether bmiColors Contains explicit red 、 green 、 blue (RGB) Value or index .IUsage The parameter must be one of the following values .
value | remarks |
---|---|
DIB_RGB_COLORS | The color table contains text RGB value . |
DIB_PAL_COLORS | This array contains... Into the logical palette of the source device context 16 Bit index . |
dwRop [ Enter the reference ]
Combine together in the specified way to form a new image source pixel 、 Current brush and target pixel of the target device context . For more information , Please refer to the remarks section below .
Return value
If the function succeeds , Then the return value is the number of rows scanned and copied . Please note that , This value can be negative image content .
If the function fails , Or no scan line is copied , The return value is 0.
If the driver does not support JPEG or PNG File image is passed to StretchDIBits, This function will fail and return GDI_ERROR. If something goes wrong , Applications must rely on their own JPEG or PNG Support , Decompress the image into bitmap , Then pass the bitmap to StretchDIBits.
remarks
Bottom up DIB The starting position of is the lower left corner ; From top to bottom DIB The starting position of is the upper left corner .
StretchDIBits Create an image of a bitmap mirror , If nSrcWidth and nDestWidth These two parameters or nSrcHeight and nDestHeight The symbols of these two parameters are different .NSrcWidth and nDestWidth Different symbols , Then this function creates an edge x Axis mirrored bitmap image .NSrcHeight and nDestHeight Different symbols , Then the function is created along y Axis mirrored bitmap image .
This function allows JPEG or PNG The image is passed in as the source image . How each parameter is used remains unchanged , Unless :
- If BITMAPINFOHEADER Of biCompression The members are BI_JPEG or BI_PNG,lpBits Directional inclusion JPEG or PNG Image separate buffer .BITMAPINFOHEADER Structural biSizeImage Member specifies the size of the buffer .IUsage The parameter has to be set to DIB_RGB_COLORS.DwRop The parameter has to be set to SRCCOPY.
- To ensure that there is an appropriate metafile cache pool when printing , Calling StretchDIBits Before , The application must call CHECKJPEGFORMAT or CHECKPNGFORMAT Escape to verify that the printer can recognize JPEG or PNG Images .
ICM: If by using SetICMMode Of iEnableICM Parameter set to ICM_ON The call of enables color management , Then color management will be implemented . If by lpBitsInfo The specified bitmap has a specified gamma and member endpoint member BITMAPV4HEADER Structure or a designation profileData and profileSize Member of or gamma and member end knot member BITMAPV5HEADER Then all pixels of the bitmap will be regarded as expressed in the color space described by these members rather than the source color space of the device context .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/148419.html Link to the original text :https://javaforall.cn
边栏推荐
- 夜神模擬器+Fiddler抓包測試App
- 300+篇文献!一文详解基于Transformer的多模态学习最新进展
- vi/vim 删除:一行, 一个字符, 单词, 每行第一个字符 命令
- Wechat nucleic acid detection appointment applet system graduation design completion (5) task statement
- Leetcode interview question 16.11 Diving board
- 微信小程序视频分享平台系统毕业设计毕设(2)小程序功能
- Leetcode interview question 16.17 Continuous sequence
- Wechat applet video sharing platform system graduation design completion (7) Interim inspection report
- Interview, about thread pool
- Wechat nucleic acid detection appointment applet system graduation design (2) applet function
猜你喜欢
Another double non reform exam 408, will it be cold? Software College of Nanchang Aviation University
MySQL installation and configuration
Wechat applet video sharing platform system graduation design completion (8) graduation design thesis template
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
Night God simulator +fiddler packet capture test app
1288_ Implementation analysis of vtask resume() interface and interrupt Security version interface in FreeRTOS
Wechat applet video sharing platform system graduation design completion (5) assignment
微信核酸检测预约小程序系统毕业设计毕设(1)开发概要
Unity学习shader笔记[八十二]增强单通道颜色渲染的黑白处理
夜神模拟器+Fiddler抓包测试App
随机推荐
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Is Guojin securities a state-owned enterprise? Is it safe to open an account in Guojin securities?
Mysql 备份的三种方式
Three methods of MySQL backup
一款简约PHP个人发卡程序V4.0版本
再放宽!这些应届生,可直接落户上海
工业软件讲堂-三维CAD设计软件的核心技术解析----讲坛第二次讲座
Wechat nucleic acid detection appointment applet system graduation design completion (5) task statement
哪个券商公司网上开户佣金低又安全又可靠
Nm02 nm module call sequence diagram and code interpretation independent of bus protocol
exness深度好文:动性系列-黄金流动性实例分析(五)
Vi/vim delete: one line, one character, word, the first character of each line command
Tower safety monitoring system unattended inclination vibration monitoring system
服务器php环境搭建教程,PHP服务端环境搭建图文详解
PR曲线和ROC曲线概念及其区别
Meal card hdu2546
Chrome 正式支持 MathML,默认在 Chromium Dev 105 中启用
Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
Détends - toi encore! Ces nouveaux étudiants peuvent s'installer directement à Shanghai
Qt官方示例:Qt Quick Controls - Gallery