dpi

How do I convert a WPF size to physical pixels?

好久不见. 提交于 2019-12-27 19:13:09
问题 What's the best way to convert a WPF (resolution-independent) width and height to physical screen pixels? I'm showing WPF content in a WinForms Form (via ElementHost) and trying to work out some sizing logic. I've got it working fine when the OS is running at the default 96 dpi. But it won't work when the OS is set to 120 dpi or some other resolution, because then a WPF element that reports its Width as 96 will actually be 120 pixels wide as far as WinForms is concerned. I couldn't find any

How do I convert a WPF size to physical pixels?

久未见 提交于 2019-12-27 19:12:51
问题 What's the best way to convert a WPF (resolution-independent) width and height to physical screen pixels? I'm showing WPF content in a WinForms Form (via ElementHost) and trying to work out some sizing logic. I've got it working fine when the OS is running at the default 96 dpi. But it won't work when the OS is set to 120 dpi or some other resolution, because then a WPF element that reports its Width as 96 will actually be 120 pixels wide as far as WinForms is concerned. I couldn't find any

Android layout not consistent across devices instead of using dp

假装没事ソ 提交于 2019-12-25 07:41:10
问题 Screenshot of first image Screenshot of other phoneI have a LinearLayout ,RelativeLayout,LinearLayout and a ImageView in it.This is basically a landing page of my app,inspite of using the dp my output is not same on the all device. There is the screenshot of two different phones. Thanks in advance <LinearLayout android:id="@+id/lb_LinearLayout" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <RelativeLayout android:id="@+id/lb_Relative

Using an external manifest to turn off Windows DPI scaling

会有一股神秘感。 提交于 2019-12-25 03:29:15
问题 I have a Java application on Windows that's launched through a packr exe. I need to turn off DPI scaling by default. I don't have control of the exe's generation. My understanding is that I can do this by adding an external .manifest file, but it doesn't seem to work. This is the manifest file, which I put at "Airships.exe.manifest" next to "Airships.exe". <?xml version="1.0" encoding="utf-8"?> <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn

Android does not honor ldpi qualifier

╄→尐↘猪︶ㄣ 提交于 2019-12-25 02:37:30
问题 I want to distinguish layout/drawables for the following two devices: 1) 7" hdpi 2) 7" ldpi So I am using the following qualified directories: 1) layout-sw600dp-hdpi / drawable-sw600dp-hdpi 2) layout-sw600dp-ldpi / drawable-sw600dp-ldpi But when I run on a 7" ldpi device with screen size in pixels 480x764, then Android (V4.0.3) chooses the hdpi version. Why is that? When I read the documentation, ldpi should be the better fit. When I remove layout-sw600dp-hdpi / drawable-sw600dp-hdpi

qHD and 800x480 different layout or drawable or both

给你一囗甜甜゛ 提交于 2019-12-24 14:16:22
问题 I have an application that has a grid with 2 columns and 5 rows. Each cell is an image and a text The application works well on 800x480. (below image) The problem is when I run the emulator for 960x540 the grid look like this (below image) Both use drawable-hdpi and layout-hdpi. Is there any way even an unorthodox to overcome this problem ? The code for the grid is <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@

DPI aware screen capture

时光怂恿深爱的人放手 提交于 2019-12-24 05:54:13
问题 I used AutoIt's _ScreenCapture_Capture() before without any trouble. But on Windows 10 with a 4k resolution screen I'm using DPI scaling at 200%. _ScreenCapture_capture() now gets something 2x zoomed in and half the location I asked for. For instance : _ScreenCapture_Capture("c:\a.bmp", 100, 100, 200, 200) ; Path, X1, Y1, X2, Y2 Does not return a 100x100 pixel square of the screen (at 100,100 to 200,200 ). It returns a 100x100 pixel square (at 50,50 to 100,100 ) instead. I did find a solution

Android, images and dpi

笑着哭i 提交于 2019-12-24 04:31:49
问题 I am using WVGA800 skin in Android emulator, so the density (hw.lcd.density) is 240. I have to put 4 image buttons (72 pixels per inch) at the bottom of activities view. As the resolution is 480X800, I asummed that the width of image must be 120 pixels. The problem is when application is launched, the 3 buttons take all width and there is no place for 4th button... Then I created button image in Fireworks with resolution 240 pixels per inch and in 120px width, but problem remains. Could

Uneven border in mobile browsers

隐身守侯 提交于 2019-12-24 04:05:09
问题 I'm developing a responsive website and has many elements with 1px border. In mobile devices (with high dpi) borders seems uneven and blurry. I know this is because of the high DPI of the screens. Any solutions? Edit: CSS .search_bar{ width:40%; height:28px; font-size:13px; outline:none; border:0px; padding:0px; float:left; background:#fff; line-height:12px; font-size:14px; text-indent:9px; letter-spacing: normal; text-align: start; text-rendering: optimizelegibility; text-shadow: none; text

Is it safe to use Delphi visual form designer in high DPI?

给你一囗甜甜゛ 提交于 2019-12-24 03:25:17
问题 In the past we were using standard 96dpi windows most of the time on developer machines, today it is common to go with 120 or even more. Is it safe to save forms in Delphi in high dpi or are there any annoyances or risks involved? I'm not asking how to do my application behave properly with different DPI modes - but asking if Delphi form designer is proven to work correctly in high dpi, so apps with the usual DPI handling techniques will work OK with forms saved with larger PixelsPerInch