dpi

How to include 10“ and 7” layouts properly

眉间皱痕 提交于 2019-11-26 18:51:42
问题 Nexus 7: 7" 1280x800 Galaxy tab 10.1 10" 1280x800 I want my app to run on 7 and 10 inch tablets. As far as I know, I have to include these layout folders in my app: for 7 inch tablets layout-sw600dp layout-sw600dp-port for 10 inch tablets layout-sw720dp layout-sw720dp-port It runs fine on the nexus 7, but loads the sw600dp layouts on the 10" tablet. If I include these default folders: layout layout-port 10" galaxy tab loads layouts from these. If I only include the default layout folders and

How to detect the screen DPI using JavaScript

旧街凉风 提交于 2019-11-26 18:21:58
问题 The only way I found till now, is getting the offsetWidth, offsetHeight of a test div element with height and width of one inch: http://www.infobyip.com/detectmonitordpi.php Is there a way to detect the screen DPI via JavaScript instead? Thanks, Atara. 回答1: <div id='testdiv' style='height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;'></div> <script type='text/javascript'> dpi_x = document.getElementById('testdiv').offsetWidth; dpi_y = document.getElementById('testdiv')

Pixel to Centimeter?

折月煮酒 提交于 2019-11-26 17:27:57
问题 I just want to know if the pixel unit is something that doesn't change, and if we can convert from pixels to let's say centimeters ? 回答1: Similar to this question which asks about points instead of centimeters. There are 72 points per inch and there are 2.54 centimeters per inch, so just substitute 2.54 for 72 in the answer to that question. I'll quote and correct my answer here: There are 2.54 centimeters per inch; if it is sufficient to assume 96 pixels per inch, the formula is rather

How can I set the dpiAware property in a Windows application manifest to “per monitor” in Visual Studio?

我只是一个虾纸丫 提交于 2019-11-26 16:33:16
I need to be able to set the dpiAware property in the manifest of my application to "per monitor". The available choices in the properties are just to enable or disable DPI awareness. Neither of these settings works for me. I can get the behavior I want for my application if I don't embed the manifest in the exe, then edit the manifest manually. I want to automatically generate and embed the manifest. Is there something I am missing? (I am using Visual Studio 2013.) dyasta New in Windows 10 is dpiAwareness as well as dpiAware , so we need to update this example a bit. Now, it is fine because

How can I get the DPI in WPF?

走远了吗. 提交于 2019-11-26 16:09:12
How can I get the DPI in WPF? http://blogs.msdn.com/jaimer/archive/2007/03/07/getting-system-dpi-in-wpf-app.aspx seems to work PresentationSource source = PresentationSource.FromVisual(this); double dpiX, dpiY; if (source != null) { dpiX = 96.0 * source.CompositionTarget.TransformToDevice.M11; dpiY = 96.0 * source.CompositionTarget.TransformToDevice.M22; } var dpiXProperty = typeof(SystemParameters).GetProperty("DpiX", BindingFlags.NonPublic | BindingFlags.Static); var dpiYProperty = typeof(SystemParameters).GetProperty("Dpi", BindingFlags.NonPublic | BindingFlags.Static); var dpiX = (int

How do I convert ppi into dpi for Android images?

痴心易碎 提交于 2019-11-26 15:06:53
I have started making graphics for my Android app using Adobe Photoshop. But I am unable to proceed, as the resolution in Photoshop is set in pixels per inch where as the official Google documentation says Android will require images set in dpi. I have searched the web for the conversion between the two but never ended up with any proper formula. I know that the Android documentation describes the relation as px = dp*dpi/160 . But my problem is that if I know dpi where do I get the value of dp to be used in this calculation? Or is there any assumption about the value of dp? I am confused. Dp

How to control the font DPI in .NET WinForms app

。_饼干妹妹 提交于 2019-11-26 15:06:16
I created an app for a small business. Some of the employees in the office can not see the form correctly. The reason is they have their DPI setting set to above 96dpi. Does anybody know of a way to control this? For all of you who have experience with winforms apps, how do you control your form layout so that DPI does not affect the look of the application? Ian Boyd Assuming you do not try to honor the user's UI font choice (SystemFonts.IconTitleFont), and hard-code your forms for one font size only (e.g. Tahoma 8pt, Microsoft Sans Serif 8.25pt), you can set your form's AutoScaleMode to

How to “correctly” detect DPI of display with Java?

≯℡__Kan透↙ 提交于 2019-11-26 14:22:26
问题 I have the following app that draws a rule : public class Rule extends JComponent { public static final long serialVersionUID=26362862L; // public static final int INCH=Toolkit.getDefaultToolkit().getScreenResolution(); public static final int INCH=(int)(Toolkit.getDefaultToolkit().getScreenResolution()*1.15); // Auto adjust this 1.15 ? public static final int HORIZONTAL=0; public static final int VERTICAL=1; public static final int SIZE=35; public int orientation; public boolean isMetric;

Disable DPI awareness for WPF application

邮差的信 提交于 2019-11-26 12:17:12
问题 Good day! I\'ve been working on a WPF app for some time now (as a learning experience and oh boy it was a learning experience) and it\'s finally ready for release. Release means installing it on my HTPC where it will be used to browse my movie collection. I designed it on my PC which runs 1920*1080 but at the normal DPI setting, while the HTPC/TV is running at the same resolution but a higher DPI setting for obvious reasons. The problem is my app goes bonkers on the HTPC, messing up pretty

How to access screen display’s DPI settings via javascript? [duplicate]

…衆ロ難τιáo~ 提交于 2019-11-26 10:31:03
问题 This question already has answers here : Detecting the system DPI/PPI from JS/CSS? (12 answers) Closed 2 years ago . Is there a way to access the screen display\'s DPI settings in a Javascript function? I am trying to position a HTML panel on the page and when the user\'s DPI is set to large (120), it throws the position off. I need to be able to know what the DPI is so I can adjust the position accordingly. 回答1: Firstly, to help with the possible (and very common) confusion with the term DPI