dpi

About DPI issue

安稳与你 提交于 2019-12-02 03:22:17
问题 I have a WIN32 SW which the UI was designed in 96 DPI, so when user changes the windows DPI from 96 to 120 or bigger, the UI will be wrong. I want to know if there is API to force my SW to display the UI with 96DPI. 回答1: Starting with Windows Vista, scaling for DPI is supposed to happen automatically. I don't have any direct experience to know how well it works, but here's the page that explains how to turn it off: http://msdn.microsoft.com/en-us/library/ms701681(VS.85).aspx 回答2: You can also

How to obtain the exact dpi value of android device?

最后都变了- 提交于 2019-12-02 03:12:54
问题 we can use DisplayMetrics.densityDpi to obtain a approximate dpi value of the device,but i eager to know how to obtain the exact dpi value? 回答1: Use DisplayMatrics.xdpi and DisplayMatrics.ydpi xdpi The exact physical pixels per inch of the screen in the X dimension. ydpi The exact physical pixels per inch of the screen in the Y dimension. getResources().getDisplayMetrics().xdpi getResources().getDisplayMetrics().ydpi 回答2: I think you can accesss this through the class DisplayMetrics and the

代码修改图片DPI

﹥>﹥吖頭↗ 提交于 2019-12-02 03:11:27
1.使用C# 修改图片DPI private void Form1_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { this.textBox1.Text = ((string[])e.Data.GetData(DataFormats.FileDrop.ToString()))[0]; } } private void textBox1_DragOver(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Copy; } using (Bitmap newImage = new Bitmap(Image.FromFile(this.textBox1.Text))) { newImage.SetResolution(300, 300); newImage.Save("123.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); } 上面是winform窗口拖拽文件,然后在修改图片DPI。测试成功,可以正常修改。 2. VC修改图片DPI 代码原理和C#一致,但是不能修改成功。 使用GDIPlus int GetImageCLSID

printing bufferedimage to a printer

感情迁移 提交于 2019-12-02 02:53:46
问题 i have an application from which i want to print an image. The image is loaded as a BufferedImage object. The problem is, when i print the image (to the postscript or to the pdf file), the quality is really poor. When i'm using some other tools (basically any picture viewer application which can print the image) the result is significantly better. I know there can be some problems with the DPI vs resolution but i'm not exactly sure how to compute the correct values for printing. I tried to

Make vb.net application DPI aware

大憨熊 提交于 2019-12-02 02:33:24
问题 I need to make my vb.net app scale up properly on any DPI setting. Currently it gets messed up if the setting is anything other than standard. Everything i found refers either to c# or to older versions of VB or to Visual Studio Pro and are not compatible to the version I am using. I am on Visual studio express 2013. Thanks 回答1: Taken from the article WinForms scaling at large DPI settings – is it even possible? on the Telerik web page Declaring the DPI awareness is done in a manifest file.

How to accurately measure mouse movement in inches or centimetres for a mouse with a known DPI

强颜欢笑 提交于 2019-12-02 02:07:50
问题 I have a Logitech G500 gaming mouse that is running at its full DPI of 5700. I'm trying to write a program in C++ that accurately measures horizontal movement of the mouse in physical units, ie. centimetres or inches. I'm using the windows API and windows raw input via the WM_INPUT message to get raw movement changes from the mouse. I'm then assuming 1 unit of movement reported through WM_INPUT is 1/5700th of an inch, and as I'm tracking the net movement of the mouse, I thought I could

How to obtain the exact dpi value of android device?

旧街凉风 提交于 2019-12-02 01:32:22
we can use DisplayMetrics.densityDpi to obtain a approximate dpi value of the device,but i eager to know how to obtain the exact dpi value? Use DisplayMatrics.xdpi and DisplayMatrics.ydpi xdpi The exact physical pixels per inch of the screen in the X dimension. ydpi The exact physical pixels per inch of the screen in the Y dimension. getResources().getDisplayMetrics().xdpi getResources().getDisplayMetrics().ydpi I think you can accesss this through the class DisplayMetrics and the field densityDpi . 来源: https://stackoverflow.com/questions/7594527/how-to-obtain-the-exact-dpi-value-of-android

How to accurately measure mouse movement in inches or centimetres for a mouse with a known DPI

◇◆丶佛笑我妖孽 提交于 2019-12-02 01:29:07
I have a Logitech G500 gaming mouse that is running at its full DPI of 5700. I'm trying to write a program in C++ that accurately measures horizontal movement of the mouse in physical units, ie. centimetres or inches. I'm using the windows API and windows raw input via the WM_INPUT message to get raw movement changes from the mouse. I'm then assuming 1 unit of movement reported through WM_INPUT is 1/5700th of an inch, and as I'm tracking the net movement of the mouse, I thought I could perform a simple calculation to yield the net physical movement: distance(inches) = total_movement_from

printing bufferedimage to a printer

蓝咒 提交于 2019-12-01 23:50:19
i have an application from which i want to print an image. The image is loaded as a BufferedImage object. The problem is, when i print the image (to the postscript or to the pdf file), the quality is really poor. When i'm using some other tools (basically any picture viewer application which can print the image) the result is significantly better. I know there can be some problems with the DPI vs resolution but i'm not exactly sure how to compute the correct values for printing. I tried to google and tried some methods, but nothing seems to work as i expected. Basicaly i just want to print an

Visual Studio and DPI issue

倾然丶 夕夏残阳落幕 提交于 2019-12-01 22:57:11
问题 I am developing a Windows Forms application using VS2008 on Windows Vista. I tried to run my application on Windows XP the other day, and everything on GUI was messed up. I realized that I developed the application using 120 Dpi setting on Windows Vista and my XP was set to 96 dpi. My application has several UserControls and all of them shrinks even in the Visual Studio itself if I change my DPI to 96. I am sure a lot of people are using Visual Studio in high DPIs these days. So how can make