dpi

Screen Resolution not matching Screen.Bounds

让人想犯罪 __ 提交于 2019-11-27 17:58:29
问题 I am seeing an interesting difference between the resolution that is set through Control Panel and the output of Screen.Bounds for my widescreen laptop. The screen is 15.5" and the resolution set through Control Panel is 1920x1080. However when I run some code like this. Screen[] screens = Screen.AllScreens; foreach (Screen scr in screens) { Console.WriteLine("Width: " + scr.Bounds.Width + ", Height: " + scr.Bounds.Width); } The output shows my resolution being 1536x864. I have done some

How to calculate the correct image size in out pdf using itextsharp?

牧云@^-^@ 提交于 2019-11-27 17:49:47
问题 I' am trying to add an image to a pdf using itextsharp, regardless of the image size it always appears to be mapped to a different greater size inside the pdf ? The image I add is 624x500 pixel (DPI:72): alt text http://www.freeimagehosting.net/uploads/727711dc70.png And here is a screen of the output pdf: alt text http://www.freeimagehosting.net/uploads/313d49044d.png And here is how I created the document: Document document = new Document(); System.IO.MemoryStream stream = new MemoryStream(

How to include 10“ and 7” layouts properly

≡放荡痞女 提交于 2019-11-27 17:06:47
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 the sw600dp one, it crashes on the nexus7. How am I supposed to support phones, 7" tablets and 10"

手机APP UI设计尺寸基础知识

烂漫一生 提交于 2019-11-27 16:33:19
现象 像素密度 倍率与逻辑像素 单位 Web怎么办 实际应用 iPhone Android Web 总结 原文 http://www.shejidaren.com/mobile-ui-chi-cun.html 对于刚入行的UI设计师,往往会遇到一个基础问题,就是设计移动APP时,是用什么尺寸或者用哪种屏幕的尺寸是最适当的?有的同学花了很长时间也不知道怎么做,为了解决这个问题,今天设计师”十萬個為什麼”为大家从原理开始介绍一下移动端设计尺寸规范。 推荐配合这个阅读:《 最新Android & iOS设计尺寸规范 》 现象 首先说现象,大家都知道移动端设备屏幕尺寸非常多,碎片化严重。尤其是Android,你会听到很多种分辨率:480×800, 480×854, 540×960, 720×1280, 1080×1920,而且还有传说中的2K屏。近年来iPhone的碎片化也加剧了:640×960, 640×1136, 750×1334, 1242×2208。 不要被这些尺寸吓倒。实际上大部分的appUI设计和移动端网页,在各种尺寸的屏幕上都能正常显示。说明尺寸的问题一定有解决方法,而且有规律可循。 回到顶部 像素密度 要知道,屏幕是由很多像素点组成的。之前提到那么多种分辨率,都是手机屏幕的实际像素尺寸。比如480×800的屏幕,就是由800行、480列 的像素点组成的

How to detect the screen DPI using JavaScript

送分小仙女□ 提交于 2019-11-27 14:02:24
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. Lixas <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').offsetHeight; </script> Then you can use JQuery to send dpi_x and dpi_y this to to your server http:/

How to read the physical screen size of OSX?

本秂侑毒 提交于 2019-11-27 12:53:22
I would like to know the physical screen size under Mac OSX. But NSDeviceResolution is always reporting wrong value (72), so the calculation result of resolution / dpi is wrong. Inside "About This Mac", there is a Mac model string there, mine is "15-inch, Early 2011". So I'm wondering should there be a way (in obj-c probably), to read that string and then I can use that as the physical screen size. Any help is appreciated. You can use CGDisplayScreenSize to get the physical size of a screen in millimetres. From that you can computer the DPI given that you already know the resolution. So e.g.

What's the correct size icon for drawable-xxhdpi?

不羁的心 提交于 2019-11-27 10:05:55
As we know, the correct sized icon: * drawable-ldpi (120 dpi, Low density screen) - 36px x 36px * drawable-mdpi (160 dpi, Medium density screen) - 48px x 48px * drawable-hdpi (240 dpi, High density screen) - 72px x 72px * drawable-xhdpi (320 dpi, Extra-high density screen) - 96px x 96px On Jelly Bean, drawable-xxhdpi can be supported. So what's the correct size icon? MDPI: 48x48 HDPI: 72x72 XHDPI: 96x96 XXHDPI: 144x144 XXXHDPI: 192x192 to create an icon for different densities, you should follow the 2:3:4:6:8 scaling ratio between the five primary densities (medium, high, x-high, xx-high, and

C# WinForms disable DPI scaling

≯℡__Kan透↙ 提交于 2019-11-27 09:07:26
I have a WinForm application which hosts many images. When I put the application on a Win7 machines that has a DPI of 120, it completely ruins the look of the form. Is there a way to disable the scaling for my form? I am aware that this is something that is not advised and that DPI should be seamless and handled by the OS. But when it comes to a skinned application, the images do not scale well. I do not have the luxury of creating images for all the DPI variations, so please don't suggest that as an answer. You'll have bigger problems when you change the AutoScaleMode property. Increasing the

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

故事扮演 提交于 2019-11-27 08:55:21
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; private int increment; private int units; // private Color rule_color=new Color(0,135,235); private Color

How do I detect if the user's font (DPI) is set to small, large, or something else?

蹲街弑〆低调 提交于 2019-11-27 06:53:49
问题 I need to find out if the user's screen is set to normal 96 dpi (small size), large 120 dpi fonts, or something else. How do I do that in VB.NET (preferred) or C#? 回答1: The best way is just to let the form resize itself automatically, based on the user's current DPI settings. To make it do that, just set the AutoScaleMode property to AutoScaleMode.Dpi and enable the AutoSize property. You can do this either from the Properties Window in the designer or though code: Public Sub New()