C#Winforms:如何更改System.Drawing.BItmap的DPI? [英] C# winforms: How to change DPI of the System.Drawing.BItmap?

查看:118
本文介绍了C#Winforms:如何更改System.Drawing.BItmap的DPI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将System.Drawing.Bitmap对象的DPI从默认值= 96更改为例如150.我找不到答案该怎么做,所以我在这里问:)

I need to change the DPI of the System.Drawing.Bitmap object from the default value = 96 to e.g. 150. I couldn't find the answer how to do that so I ask here :)

推荐答案

Bitmap result = new Bitmap(width, height);
result.SetResolution(dpi, dpi);

这篇关于C#Winforms:如何更改System.Drawing.BItmap的DPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆