惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
V2EX - 技术
V2EX - 技术
博客园 - 【当耐特】
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
有赞技术团队
有赞技术团队
S
Schneier on Security
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
Project Zero
Project Zero
博客园 - 司徒正美
P
Privacy International News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Security Latest
Security Latest
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
L
Lohrmann on Cybersecurity

博客园 - 祥子哥哥

纪念一下我的20年的博客园。 [转]OPC.Client for DA and UA 使用C#开发库UcAsp.OPC.Client使用案例 推荐一个.Net的轻型RPC服务UcAsp.RPC Lucene.Net Kmeans++算是DONet实现 tinymce上传文件插件。 C#中图片处理中定义显示区域[或者可以称为蒙板效果] Jpg保存图片确认质量 Flex在子控件操作父窗口函数 Flex 不同 application 之间传参数(转) - 祥子哥哥 刚刚写的一个加密算法 如何在DropDownList第一項加入新項目 2003服务器中出现"请求的资源在使用中"错误的解决方法 如何在.Net中访问MySQL数据库 MS SQL日志清理代码 Server Application Error Javascript检测Flash插件是否安装及版本号 最近ASP.NET WAP开发的一些情况! 数据库备份
C#生成的图片如何设置DPI
祥子哥哥 · 2009-07-25 · via 博客园 - 祥子哥哥

DPI在印刷中起到很的作用,决定印刷的质量。
但是c#中GDI都是采用默认的DPI--即你显示器的DPI。
这个就比较麻烦了,比如进入打印,或者印刷往往尺寸不对。
其实Bitmap里面有个属性专门设置DPI的,“SetResolution”
使用方法就是

 Bitmap bmp = new Bitmap(width, height);
 bmp.SetResolution(DPI, DPI);

第一个参数表示x坐标上的dpi,第二个就是y坐标上的dpi;