dpi

SetWindowPos() cross-process DPI aware

折月煮酒 提交于 2020-01-02 05:22:12
问题 I am creating a program that moves/resizes windows from another process with SetWindowPos() . My own program is PROCESS_PER_MONITOR_DPI_AWARE . The other programs could be anything from PROCESS_DPI_UNAWARE , PROCESS_SYSTEM_DPI_AWARE or PROCESS_PER_MONITOR_DPI_AWARE . Because my own program is PROCESS_PER_MONITOR_DPI_AWARE , the coordinates I pass to SetWindowPos() are in physical coordinates. What I now want to do is resize the client area to a specific size in logical coordinates . What I

WPF Application same size at every system scale (scale independent)

时光毁灭记忆、已成空白 提交于 2020-01-02 03:29:30
问题 Is there any way to make WPF application get same size at every system scale? When I change Change size of text, apps and other items in windows system setting from 125% (Recommended) to 100% in a Full-HD screen, My WPF application gets too small. To implement independent system scale application I've wrote a function like this to change scaling of my app back to 125%: private void ScaleTo125Percents() { // Change scale of window content MainContainer.LayoutTransform = new ScaleTransform(1.25

matplotlib linewidth when saving a PDF

旧巷老猫 提交于 2019-12-31 14:56:14
问题 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

Differences between scaling images with dpi as opposed to dp

橙三吉。 提交于 2019-12-31 06:43:13
问题 I have all of the dpi drawable directories (are xxhdpi and xxxhdpi even necessary?) consisting of nine-patch bitmaps, the drawable resource file in the drawable directory that retrieves all of the scaled bitmaps, and I set the backgrounds of the Buttons with the drawable resource file... Now, my problem is that I also created "scaled" layout directories in terms of size (small, normal, and etc.), in which I tried to manually change the dp of the buttons as follows: Here's my xhdpi bitmap: ...

System.Drawing.Graphics.DpiX always return 96

余生长醉 提交于 2019-12-31 04:48:26
问题 I have vb.net winform app that has AutoScaleMode = dpi AutoScale = false AutoSize = true I've signed off after changing DPI setting. I also tried restarting the machine. Using g As Graphics = form.CreateGraphics() Dim dpiX As Single = g.DpiX dpiX is always 96 regardless of DPI setting. Anyone know what I am doing wrong? 回答1: I found solution. My app's manifest has to say it is dpiAware. Because I am trying to detect high DPI and show a warning message box and not really trying to make my app

C# WPF SizeChanged event doesn't update width and height when maximized

痞子三分冷 提交于 2019-12-30 09:48:10
问题 I was trying to update my controls when the size of the form changed using SizeChanged . It worked perfectly, except when going full screen. I searched the grid events but couldn't find any events that occur when the user maximizes the window (goes full screen). 回答1: I was able to receive SizeChanged event on maximize: private void window1_SizeChanged(object sender, SizeChangedEventArgs e) { var a = window1.ActualHeight; var b = window1.ActualWidth; var c = window1.Height; var d = window1

C# WPF SizeChanged event doesn't update width and height when maximized

拜拜、爱过 提交于 2019-12-30 09:48:07
问题 I was trying to update my controls when the size of the form changed using SizeChanged . It worked perfectly, except when going full screen. I searched the grid events but couldn't find any events that occur when the user maximizes the window (goes full screen). 回答1: I was able to receive SizeChanged event on maximize: private void window1_SizeChanged(object sender, SizeChangedEventArgs e) { var a = window1.ActualHeight; var b = window1.ActualWidth; var c = window1.Height; var d = window1

How to find real display density (DPI) from Java code?

此生再无相见时 提交于 2019-12-29 09:05:48
问题 I'm going to do some low-level rendering stuff, but I need to know real display DPI for making everything of correct size. I've found one way to do this: java.awt.Toolkit.getDefaultToolkit().getScreenResolution() — but it returns incorrect result on OS X with "retina" display, it's 1/2 of the real DPI. (In my case it should be 220, but it's 110) So either some other, more correct API must be available, or alternatively I need to implement a hack just for OS X — somehow find if the current

how can i change the dpi of an image with the imagick extension

混江龙づ霸主 提交于 2019-12-29 07:04:38
问题 I need to change all uploaded files to 72 dpi. I'm using the php imagick extension. heres what i've tried (the image i'm using is 300dpi): $image = new Imagick(); $image->setResolution(72,72) ; $image->readImage($img); $image->resampleImage (72,72,imagick::FILTER_UNDEFINED,1); $image->writeImage($target) this doesn't seem to anything. the image is uploading, but stays at 300dpi 回答1: MatTheCat's answer is spot on. You might also try setImageUnits() to ensure it's working with inches and not

What dpi resolution is used for an iPhone App?

…衆ロ難τιáo~ 提交于 2019-12-28 08:10:09
问题 I am working on a template for an iPhone App and was wondering what dpi resolution is used for it ? 300 or 72 ? I am not sure and I hope somebody can answer me that question. 回答1: iPhones iPhone 1/3G/3GS 320 x 480 163 ppi iPhone 4/4S 640 x 940 326 ppi iPhone 5/5C/5S 640 x 1136 326 ppi iPhone 6/6S 750 x 1334 326 ppi iPhone 6 Plus/6S Plus 1080 x 1920 401 ppi Without downsampling: 1242 x 2208 461 ppi Except for the 6th generation (= 5th) iPod touch, all the models are equal to their iPhone