FIX Coordinates with windows DDK
来源:互联网 发布:淘宝双11广告视频 编辑:程序博客网 时间:2024/06/08 01:25
【问题】用Microsoft Edge使用自己实现的虚拟打印机(Unidrv)打印页面到PDF,图片特别小,但是用IE打印就正常。
【分析】 Debug发现:用IE打印图片进OEMStretchBlt函数,但是用Edge打印图片进的是OEMPlgBlt函数,oemuni用的是目标的区域,而后者的目标区域是一个平行四边形,而且目标区域的类型是POINTFIX。维基一下,Fixed point是用整形表示浮点型,所以需要知道小数部分占几位,再查看DDK,是28.4,所以小数部分占4位,得到的这个值需要除以16,才能换算到整数部分。
维基:https://en.wikipedia.org/wiki/Fixed-point_arithmetic
DDK:FIX Coordinates
GraphicsDDIs use fractional coordinates that can specify a location on the devicesurface within one-sixteenth of a pixel. (On vector devices, the fractionalcoordinates are sixteen times more accurate than the device resolution.) Thefractional coordinates are represented as 32-bit numbers in signed 28.4 bit FIX notation. In this notation, the highest-order28 bits represent the integer part of the coordinate, and the lowest 4 bitsrepresent the fractional part. For example, 0x0000003C equals +3.7500, and0xFFFFFFE8 equals -1.5000.
FIXcoordinates represent control points for lines and Bezier curves. For certainobjects, such as rectangular clip regions, GDI uses signed 32-bit integers torepresent coordinates. Because coordinates are 28-bit quantities, the highest 5bits of an integer coordinate are either all cleared or all set.
【解决办法】
if (pco->iDComplexity==DC_RECT){//28.4 fix pointrtlDes.left = LONG(pptfixDest[0].x / 16.0 + 0.5); rtlDes.top = LONG(pptfixDest[0].y / 16.0 + 0.5);rtlDes.right = LONG(pptfixDest[1].x / 16.0 + 0.5);rtlDes.bottom = LONG(pptfixDest[2].y / 16.0 + 0.5);}
- FIX Coordinates with windows DDK
- windows DDK
- windows ddk
- DDKBUILD - Integrating the Windows DDK with Visual Studio .Net
- Coordinates
- Windows DDK要点指南
- DDK for windows
- windows ddk下载
- windows ddk下载
- windows ddk 下载地址
- windows ddk hid 开发
- windows sdk ddk wdk
- Windows 2003 SP1 DDK下载
- windows驱动ddk环境设置
- projecteuler No.91 Right triangles with integer coordinates
- Project Euler:Problem 91 Right triangles with integer coordinates
- Fix bugs with core dump
- Fix the Problem with MergeList
- android listview左划删除与点击事件及item样式扩展
- 第二个wp app上架-- owl Bus
- linux中内存使用,swap,cache,buffer的含义
- 度量快速开发平台中DataTable.Select的一些其他用法
- No matching provisioning profiles found
- FIX Coordinates with windows DDK
- centos65 安装 脸书的proxygen
- UESTC 757 棋盘 博弈、策略
- win7 mysql 免安装版 配置注册问题
- Homestead 集成开发环境配置
- 测试工具ab.exe 的使用
- TFS(一)--概述
- CLRS 16.2贪心算法的原理
- 【DP】 cf 321E