dpi

Disable DPI awareness for WPF application

匿名 (未验证) 提交于 2019-12-03 02:26:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Good day! I've been working on a WPF app for some time now (as a learning experience and oh boy it was a learning experience) and it's finally ready for release. Release means installing it on my HTPC where it will be used to browse my movie collection. I designed it on my PC which runs 1920*1080 but at the normal DPI setting, while the HTPC/TV is running at the same resolution but a higher DPI setting for obvious reasons. The problem is my app goes bonkers on the HTPC, messing up pretty much everything as far as visuals go. I know this is

Problems getting WinForms to scale correctly with DPI

匿名 (未验证) 提交于 2019-12-03 02:26:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm running into problems with getting a WinForms app to display correctly at high DPI settings. I've checked various web sites, and the WinForms all have the correct AutoScaleMode. I've tried setting this to both DPI and Font. However, the forms always get cut off near the bottom when using high DPI settings (e.g. 125%). I added some code to check, and if I set AutoScaleMode to DPI, when the form loads, I see that AutoScaleDimensions is 120,120 when the form loads, and CurrentAutoScaleDimensions is also 120,120. In the Form.designer.cs file

Android - how to get or set (print) DPI ( dots per inch ) of JPEG file while loading or saving it programmatically?

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have an app developed on Android versions 4.0 and above. ( The app does not support Android versions below 4.0 [Ice Cream Sandwich] ). The question is related to (print) DPI of various images ( for eg. of jpeg or png ) format. This question does NOT relate to SCREEN DPI or sizes of various Android devices. It is also NOT related to showing the Bitmap on the device in screen size. I am using the following code to load the image file in 'Bitmap'. Then I have been cropping it and saving it to another file in JPEG format with

DPI in Retina iPad app design

北战南征 提交于 2019-12-03 01:45:21
I don't know if this belongs in StackOverflow or some other SE site, but here goes. I have a PSD design I have an iOS development team turning into a Retina iPad app. However, this design is made in the default 72 dpi. The development team is now saying the design should be 264 dpi (same as a Retina iPad) -- as well as a 132 dpi version for the non-Retina edition. This confuses me, as I was under the impression that dpi just represents how many pixels go into an inch of output, and therefore would only matter in printing. The dpi of an iPad just represents the number of pixels for each inch of

How do I get monitor resolution in Python?

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the simplest way to get monitor resolution (preferably in a tuple)? 回答1: On Windows: from win3 2 api import GetSystemMetrics print "Width =", GetSystemMetrics(0) print "Height =", GetSystemMetrics(1) Based on this http://bytes.com/topic/python/answers/618587-screen-size-resolution-win3 2 -python 回答 2 : In Windows, you can also use ctypes: import ctypes user3 2 = ctypes.windll.user3 2 screensize = user3 2 .GetSystemMetrics(0), user3 2 .GetSystemMetrics(1) so that you don't need to install the pywin3 2 package; it doesn't need anything

c# Pinvoke for GetWindowDpiAwarenessContext

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to implement GetWindowDpiAwarenessContext in a C# application with no success. The relevent header files are: windef.h DECLARE_HANDLE(DPI_AWARENESS_CONTEXT); typedef enum DPI_AWARENESS { DPI_AWARENESS_INVALID = -1, DPI_AWARENESS_UNAWARE = 0, DPI_AWARENESS_SYSTEM_AWARE = 1, DPI_AWARENESS_PER_MONITOR_AWARE = 2 } DPI_AWARENESS; #define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1) #define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2) #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT

How to change resolution (DPI) of an image?

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a JPEG picture with a DPI of 72. I want to change 72 dpi to 300 dpi. How could I change resolution of JPEG pictures using C#? 回答1: This article talks about modifying the EXIF data without the re-saving/re-compressing (and thus loss of information -- it actually uses a "trick"; there may be more direct libraries) required by the SetResolution approach. This was found on a quick google search, but I wanted to point out that all you need to do is modify the stored EXIF data. Also: .NET lib for EXIF modification and another SO

matplotlib linewidth when saving a PDF

不问归期 提交于 2019-12-03 01:24:54
I have a figure with some fairly delicate features that are sensitive to linewidth. I want to save this figure as a PDF that can be easily printed (i.e. no scaling on the receiver's side, just Command+P and go). Unfortunately, when I set figsize=(8.5,11) in order to correctly size the PDF for printing, matplotlib picks a very thick default linewidth and text size that mess up the plot (the legend is too large and the lines in the bar chart overlap). If I set figsize=(17,22) I get a very workable default linewidth and textsize after scaling the PDF to 50% for printing. This is what I have been

DPI Graphics Screen Resolution Pixels WinForm PrintPageEventArgs

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How do Dpi Points relate to Pixels for any display my application is running on? int points ; Screen primary ; public Form1 () { InitializeComponent (); points = - 1 ; primary = null ; } void OnPaint ( object sender , PaintEventArgs e ) { if ( points < 0 ) { points = ( int )( e . Graphics . DpiX / 72.0F ); // There are 72 points per inch } if ( primary == null ) { primary = Screen . PrimaryScreen ; Console . WriteLine ( primary . WorkingArea . Height ); Console . WriteLine ( primary . WorkingArea . Width ); Console . WriteLine (

How to get Image DPI in PHP [duplicate]

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Get/set DPI with PHP GD/Imagick? 3 answers I am searching for the code which could help me to get the Image DPI in PHP. Could any one look into this ? Thanks in advance. 回答1: You can go for some image libraries for that. Eg: Imagick, GD Library... (OR) You can use the following function, function get_dpi($filename){ $a = fopen($filename,'r'); $string = fread($a,20); fclose($a); $data = bin2hex(substr($string,14,4)); $x = substr($data,0,4); $y = substr($data,0,4); return array(hexdec($x),hexdec($y));