dpi

Android, WebView.getWidth() == window.innerWidth

心不动则不痛 提交于 2019-12-11 08:26:26
问题 What combination of META tag settings in HTML and WebSettings in Java should I use to get the following result: window.innerWidth in Javascript should be always (in any Android version and on any device) equal to the WebView width in pixels. For instance, I set the WebView width to 1024px. In Android AVD emulator, window.innerWidth is equal to 683px (2/3 of 1024, or 150% scale). I tried the following META: <meta name="viewport" content="width=device-width; user-scalable=no; initial-scale=1.0;

What size of ImageList icons do I need to make & load for my app (considering higher DPI)?

强颜欢笑 提交于 2019-12-11 06:04:34
问题 I have a CListCtrl control (or a ListView in Win32) that is created with LVS_REPORT style. I am intending to display icons in its items as such: But the question is what size of icons do I need to make and load? Let me explain. From the old Win32 samples, I can see that everyone creates image lists with 15x15 pixel icons. But the issue with those is that it looks horribly pixelated on any modern PC with higher DPI settings. Thus I was looking for a dynamic way to determine the appropriate

Marking Your Python Program as High DPI Aware Seamlessly Windows

梦想的初衷 提交于 2019-12-11 03:21:24
问题 I just wanted to share the best way I found to do this in case other people were having issues as I was. If your Python/Kivy program has graphic issues with Virtual DPI scaling try this code out. It'll mark the program as High DPI Aware for you or the end user without having to do anything. This works for Windows 10, not sure about 8 or 7. Was wondering if anyone else knows if this will work for 8 and 7. To test this out, add the code in, set DPI up, log out and back in of user so the

Auto-Scale but still process WM_DPICHANGED

夙愿已清 提交于 2019-12-10 20:22:02
问题 I'm having a bit of a problem with a very complicated WinForms application written in C#. I want the application to let Windows auto-scale when the DPI is changed but I still need to hook the WM_DPICHANGED event in order to scale some custom drawn text. The dilemma is that if I leave the application DPI unaware the WM_DPICHANGED message is never intercepted in the DefWndProc and the proper DPI scale can never be retrieved but the form "auto-scales" the way I want. But if I make the

What is the relevance of DPI in BitmapSource.Create() method?

耗尽温柔 提交于 2019-12-10 13:29:38
问题 i read the Wikipedia article on DPI, but it confused me even more... i don't have any DPI information on the image. What DPI should i use with BitmapSource.Create(), is it OK to use a constant one(96/72?) and does it really matter if i'm not going to be printing the image? 回答1: DPI does not affect the pixels of a bitmap in any way. The DPI of an image is just attached metadata that is a measurement used to describe how large in real-world measurements is each pixel supposed to be. For example

php detect dpi of image in a pdf

拟墨画扇 提交于 2019-12-10 11:47:15
问题 I've tried a few tests using Imagick::getImageResolution on a PDF, and I can't figure out how to get the resolution (and colourspace) of an image embedded in a PDF. I've tried ripping the image out of the PDF, but during that process it seems the DPI is arbitrarily set to 72 not mater what I do. I saw in 1564529 someone said DPI doesn't matter to a PDF, but that is not true (when an image is embedded in a PDF, several attributes about the image, like resolution, are defined in the PostScript)

Android drawables - use xhdpi for hdpi

醉酒当歌 提交于 2019-12-10 10:34:48
问题 Last two questions stayed unanswered, I hope "third one's the charm" works :) I want application that is HDPI use those drawables in folder "drawable-xhdpi" and LDPI devices those in "drawable-mdpi". So I don't have to duplicate same images. Is this possible? 回答1: Yes, Android scales drawables, selecting the drawable that will produce the best result. But not all scaling combinations work that well. Downscaling to MDPI can produce noticeably poor results. XHDPI to HDPI generally produces

Graphics.MeasureString returns different values than Win32 GetTextExtent

天大地大妈咪最大 提交于 2019-12-10 10:06:06
问题 i've been trying to find a method in C# to measure the size of a string. The standard method to measure a string in Win32 is to use GetTextExtent. The real goal is to find the average width and height of a font character. The standard method to find the average width of a character starts from getting the width of all alphabetic characters and divide by 52: size = dc.GetTextExtent( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 52); averageWidth = size / 52; Microsoft has a page that

How can I get the real size of the (lcd) display diagonal, i.e. if a it is a 17 inch or 19 inch or other?

拥有回忆 提交于 2019-12-10 08:01:07
问题 This is useful for me because I have to map objects with a correct dimension on screen; if I'm using a 19" lcd with 1280x1024 resolution and a normal 96dpi setting then in order to map a correct 1-inch square I have to write a xaml like this <Rectangle Name="one_inch_side_on_19_inch_diag_display" Height="86" Width="86" Fill="Blue"/> where Width and Height are put to 86 because 86 ~= 96 (dots-per-inch) * 17 (inches) / 19 (inches) as windows assumes 96dpi on a 17" monitor as the base to

SetProcessDpiAwareness not having effect

落爺英雄遲暮 提交于 2019-12-10 02:43:38
问题 I've been trying to disable the DPI awareness on a ClickOnce application. I quickly found out, it is not possible to specify it in the manifest, because ClickOnce does not support asm.v3 in the manifest file. The next option I found was calling the new Windows function SetProcessDpiAwareness. According to this tutorial, Call SetProcessDpiAwareness before you create the application window. And this tutorial, you must call SetProcessDpiAwareness prior to any Win32API call You have to call the