dpi

Programmatically determine DPI via the browser?

孤人 提交于 2019-12-03 10:06:01
I would like to programmaticaly determine the DPI of a user's display in order to show a web page at a precise number of units (centimeters/inches). I know it a weird request: it's for a visualization research project and it's kind of a control. We currently do it by having the user place a credit card to the screen and match a resizable div (via Mootools) to the real credit card, and voila we can get the DPI and display the page correctly. Can anyone think of a programmatic way to do this? Randolpho If you're doing this in javascript/mootools, CSS units are your friend. You can specify sizes

Mixed WPF and winforms project DPI awareness

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a C# program that uses both winforms and WPF and I'm struggling to get it to work in high DPI environments. Currently, if I remove all WPF projects from the solution and run it, it will scale fine, however as soon as I add any wpf back in (necessary for the functionality) the scaling fails and the UI becomes unusable. This seems like the exact same issue as previous SO questions: DPI Scaling in .Net 3.5 in Mixed WinForms and WPF Application and Problems getting WinForms to scale correctly with DPI I followed the advice on these

R, how to set the size of ggsave exactly

牧云@^-^@ 提交于 2019-12-03 06:49:58
问题 R question. I got so confused by the width , height , dpi and unit . Why the following two size different? ggsave(filename = "foo.png",ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point(size=2, shape=23),width = 5, height = 4, dpi = 300, units = "in", device='png') and ggsave(filename = "foo.png",ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point(size=2, shape=23),width = 5, height = 4, dpi = 72, units = "in", device='png') I set both of the picture's size 5 (inches) * 4 (inches). But why when I change

WPF Web Browser Control and DPI Scaling

 ̄綄美尐妖づ 提交于 2019-12-03 05:14:54
I'm working with a WPF application that uses the Web Browser control and I'm having issues with High DPI scaling. It looks like the Web Browser control is not properly respecting the DPI settings of the system, while the rest of the WPF application is properly scaling the UI. This means that on higher scale levels the WPF interface gets larger while the Web browser content stays on the original, now smaller looking size. Here's an example of screen captures from a WPF app that uses two Web Browser Controls. 100% Scaling: 150% Scaling: Notice in the second image the Web Browser scaling is much

Problems wih minSdkVersion 1.5

对着背影说爱祢 提交于 2019-12-03 03:28:06
we have a problem related to the manifest file and the property "android:minSdkVersion". The issue is: If our platform is 2.0 and we use the property "android:minSdkVersion=3" (3 = sdk 1.5) the graphics get corrupted (In details, the application's resolution get reduced to a 2/3 part of the original size, this is, when the resolution should be 480x720, it becomes in a 320x480). This is happening on the Android emulator, and on the devices Droid/Milestone (Which are platforms 2.0). When we switch the property to "android:minSdkVersion=4" (4 = sdk 1.6) the problem gets solved, but when we want

Display image with a zoom = 1 with Matplotlib imshow() (how to?)

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to display an image (say 800x800) with Matplotlib.pyplot imshow() function but I want to display it so that one pixel of the image occupies one pixel on the screen (zoom factor = 1, no shrink, no stretch). I'm a beginner, so do you know how to proceed? 回答1: Matplotlib isn't optimized for this. You'd be a bit better off with simpler options if you just want to display an image at one-pixel-to-one-pixel. (Have a look at Tkinter, for example.) That having been said: import matplotlib.pyplot as plt import numpy as np # DPI, here, has

Windows Forms window changes its size when I create a WPF window

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a System.Window.Forms.Form where I handle every button click. When I receive the first event I create a new WPF System.Windows.Window object. class WPF_Window : Window { } public partial class Form1 : Form { WPF_Window wnd = null; public Form1() { InitializeComponent(); } private void Form1_MouseClick(object sender, MouseEventArgs e) { if (wnd == null) { wnd = new WPF_Window(); } } } On my computer this code works as expected, but if I run it on another computer (both Windows 10) when I click the Windows Forms window changes its size

Do PNGs (or JPGs) have a DPI? Or is it irrelevant when building for retina?

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A simple question that I have been having great difficulty finding a definitive answer to: do PNG files have a DPI? Or perhaps more importantly, is it even relevant when building retina-enabled sites/apps? I've just received PSD assets from our designer for a retina iPad app that I must convert into HTML for display within the app. Typically, I receive such files as 2048x1536 @ 72 DPI -- double size but standard screen DPI. I then typically use CSS to tell the browser how to display it. But this time the designer was instructed to provide

Calculating image size in inches or dpi from pixels using php

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to calculate an approximate image size in inches assuming 300dpi. I have a target image size in mind, and i want to show the user if the image they have uploaded is adequate, or will need to be stretched, and offer various conditional messages based off of this. I already have the height and width in pixels, just need to know the math i guess. 回答1: DPI = "dots per inch". One dot = one pixel. 300 pixels in 300 dpi: 1 inch. You can work it out :-) 回答2: Given that dots == pixels: size in inches = size in pixels / dots per inch so if you

Troubleshooting DPI Virtualization and DPI-aware applications, in Windows Vista and Windows 7

∥☆過路亽.° 提交于 2019-12-03 02:26:06
问题 I have a problem where an application (written in Delphi) is behaving properly at default 96 DPI settings on all systems, but is behaving inconsistently at the "150% text size" (internally 144 dpi) setting, on different systems. It seems that on some systems, that certain text/font parts of my application are being stretched and on other systems, they aren't. I would have thought that my application, on a certain version of Windows (Win7), at a certain DPI, should behave the same way. Either