dpi

Android: Purpose of using images with different pixel density?

爱⌒轻易说出口 提交于 2019-12-06 14:56:44
I know using images with different DPI is a fairly common practice in Android. But I don't really see the purpose of it, why can't we just use a ultra huge image and then scale it in the program? I know we probably need to do extra calculation if we don't images in different DPI, but besides that, is there's any other reason? Tim and a.d. have the correct reasoning for you. Here's a visual example if you'd like to see a comparison between something rescaled or drawn at the correct size. Effects are always more noticeable if there are very small details. The first is a large 200x200 (we'll call

iTextSharp get PDF DPI

允我心安 提交于 2019-12-06 12:03:46
How can I get the DPI of the PDF that I am reading from my hard drive into iTextSharp? PDF's do not necessarily use DPI in their definitions. PDF's allow the document creator to define their own user coordinate space which may or may not map to anything similar to Dots Per Inch. MK. Check this How to calculate the correct image size in out pdf using itextsharp ? PDF UserUnit shall give the size of default user space units, in multiples of 1 ⁄ 72 inch. ISO-32000-1 (section 8.3.2.3) tells us “the default for the size of the unit in default user space (1/72 inch) is approximately the same as a

Android drawables - use xhdpi for hdpi

懵懂的女人 提交于 2019-12-06 11:29:38
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? 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 pretty good results. But given that the overwhelming majority of devices these days are HDPI, it's probably

Android: Huge difference in memory consumption when using drawable vs drawable-nodpi folders

女生的网名这么多〃 提交于 2019-12-06 08:26:03
问题 I have basic Android application created with Android Studio with single image loaded in ImageView like this: ImageView iv = (ImageView)findViewById(R.id.imageView); iv.setScaleType(ImageView.ScaleType.CENTER_CROP); iv.setImageResource(R.drawable.g01); Image size is 1280x853 pix , nothing huge. When I store the image in drawable folder runtime memory consumed by app is 24.35 MB vs 11.85 MB when image is stored in drawable-nodpi folder. Tested on xhdpi device with resolution of 1280x720 pix .

Set ApplicationDPI in AS3 Mobile application

风流意气都作罢 提交于 2019-12-06 07:58:25
问题 I developing an application in Flash Builder with AS3 only (no flex stuff). In flex it is possible to set the application's dpi by the following code: <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="320"> But I using only AS3. I have read that it is not possible to change the application's DPI in run-time (with AS3), but how can I set this in project settings, compiler settings or is there another way to do it?

C# code to get maximum dpi of installed or selected printer

一世执手 提交于 2019-12-06 07:23:18
I want to get Maximum Dpi of installed or selected printer. I tried PrinterSettings ps = new PrinterSettings(); MessageBox.Show(ps.PrinterResolutions.ToString()); and I get this output: System.Drawing.Printing.PrinterSettings+PreinterResolutionCollection (The desired output is 600x600). Using LINQ: PrinterSettings ps = new PrinterSettings(); var maxResolution = ps.PrinterResolutions.OfType<PrinterResolution>() .OrderByDescending(r => r.X) .ThenByDescending(r => r.Y) .First(); MessageBox.Show(String.Format("{0}x{1}", maxResolution.X, maxResolution.Y)); It looks like PrinterResolutions is a

Enhanced system DPI scaling with VS2017

淺唱寂寞╮ 提交于 2019-12-06 04:17:41
问题 I have a MFC app that has default MFC DPI support: it is high DPI aware, but not per-monitor DPI aware. Windows 10 version 1703 added support for System (enhanced) DPI scaling. I enabled this mode from Windows Explorer in the .exe compatibility settings, and it works for my app. Ideally, I'd make the app fully multi-monitor DPI compliant, but that's a fair amount of work. So instead, I want to tell the OS to use system (enhanced) DPI scaling for my app, if the OS supports it. Does the

Win32 app not affected by dpi setting when hosted by WPF app

耗尽温柔 提交于 2019-12-06 01:15:59
I'm launching an old win32 app as a child in a wpf app. The problem is that the win32 app ignores the dpi setting when run as a child of the wpf app. The dpi setting has the desired effect on the win32 app when launched in its own window. I've assumed that the wpf app is "dpi aware" and the win32 app becomes so when childed. I would like to get the win32 child app to be sized according to the dpi setting like it is when launched alone. 来源: https://stackoverflow.com/questions/26473511/win32-app-not-affected-by-dpi-setting-when-hosted-by-wpf-app

SetProcessDPIAware seems not to work under windows 10

眉间皱痕 提交于 2019-12-06 00:08:16
问题 I am trying to get the real screen resolution (in pixels) in a windows C++ app. When the windows dpi setting is changed, I get the virtual (adjusted) resolution instead of the real one. I have tried using SetProcessDPIAware, SetProcessDpiAwareness (with all three enumerated values as arguments) and a true setting in a manifest. In all three cases, the code works fine (i.e. shows the real resolution) in my windows 7 PC but not in a Win 10 one (here it ignores the DPI Aware setting and returns

Graphics.MeasureString returns different values than Win32 GetTextExtent

断了今生、忘了曾经 提交于 2019-12-05 22:33:33
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 lists the average character widths for some font sizes at certain DPI settings, and i've confirmed