dpi

WPF DPI rendering issues with two borders

点点圈 提交于 2019-12-01 21:45:01
问题 Enviroment Win 8, VS 2012, .NET 4, WPF, screen native resolution 1920x1080@96DPI XAML <Border BorderThickness="1" BorderBrush="Red" Width="20" Height="20"> <Border BorderThickness="1" BorderBrush="Blue" /> </Border> The problem The borders look fine when DPI is 96, but if I change the DPI to 120, the borders are no longer perfectly pixel aligned. What I have tried 1) Setting the following properties - RenderOptions.EdgeMode="Aliased" SnapsToDevicePixels="True" UseLayoutRounding="True" - on

Python/PyQt4: How do you find the SIZE of a monitor (in inches)?

拟墨画扇 提交于 2019-12-01 21:16:12
I'm trying to find the horizontal width of a monitor in inches or cm (not pixels!) to make a small "ruler" program. DPI would work too. I'm using PyQt4. try using the QDesktopWidget's width() and height() to get the width and height respectively. Class reference at QDesktopWidget Class Reference , this will give you the screens size in pixels and then use QX11Info.appDpiX , this will give you the DPI in pixels per inch. Use both the above info to calculate the screen size in inches. PS: The width() returns the union width, so in case you have multiple screens, it will return union width of all

Visual Studio and DPI issue

别说谁变了你拦得住时间么 提交于 2019-12-01 21:05:55
I am developing a Windows Forms application using VS2008 on Windows Vista. I tried to run my application on Windows XP the other day, and everything on GUI was messed up. I realized that I developed the application using 120 Dpi setting on Windows Vista and my XP was set to 96 dpi. My application has several UserControls and all of them shrinks even in the Visual Studio itself if I change my DPI to 96. I am sure a lot of people are using Visual Studio in high DPIs these days. So how can make sure that my GUI does not get messed up both in Visual Studio and runtime? EDIT: I have read couple

Excel,单元格内自动换行自动行高,打印预览出现内容缺失解决方案

[亡魂溺海] 提交于 2019-12-01 20:22:24
解决方案: office2019为例, 进入打印预览界面之后选择'页面设置'.   更改打印质量, 然后选择表现最好的那一项.(此处选择的是144dpi,请根据自己的硬件设备选择) 调整后效果 如果需要把当前设置的文件输出PDF文件, 则可以通过Adobe PDF虚拟打印机输出. 原因分析: Excel单元格内自动换行显示出错, 其实是个历史遗留问题. 起初以为是我用的office2013太过古老, 更新到2019依然如故. 查找解决方案也没有什么较好的解决方案. 看到一些前辈通过更该屏幕分辨率, 调低DPI来解决. 才意识到这个问题并不是文件内的排版问题, 也不是office套件有什么bug. 只是显示屏和打印机之间的清晰度出入造成问题. 想要根治这个问题只能通过规范硬件达成协议. 用户端可以通过更改 屏幕dpi 或者 打印机dpi 来改善. 相对而言, 打印机的清晰程度在Excel中设置更简单顺手. 来源: https://www.cnblogs.com/jrri/p/11716642.html

WPF DPI rendering issues with two borders

喜夏-厌秋 提交于 2019-12-01 20:08:53
Enviroment Win 8, VS 2012, .NET 4, WPF, screen native resolution 1920x1080@96DPI XAML <Border BorderThickness="1" BorderBrush="Red" Width="20" Height="20"> <Border BorderThickness="1" BorderBrush="Blue" /> </Border> The problem The borders look fine when DPI is 96, but if I change the DPI to 120, the borders are no longer perfectly pixel aligned. What I have tried 1) Setting the following properties - RenderOptions.EdgeMode="Aliased" SnapsToDevicePixels="True" UseLayoutRounding="True" - on both borders, mitigates the anti-aliasing and bleeding issues from the higher DPI, but the inner border

.NET - Bitmap.Save ignores Bitmap.SetResolution on Windows 7

心不动则不痛 提交于 2019-12-01 17:05:50
I'm writing a .NET 4 application that imports and saves images for printing. It's important that the saved images resolution (DPI not pixel dimensions) be set to the value we specify so they print correctly. Some of the images we import come without the resolution value (bad EXIF when they were generated), so we have to correct that before writing them. We use Bitmap.SetResolution for that. It works fine on XP and Windows 8, but when we write (Bitmap.Save) the images on Windows 7, they are always written with the original resolution meta info, ignoring SetResolution. Here's a test we made,

.NET - Bitmap.Save ignores Bitmap.SetResolution on Windows 7

狂风中的少年 提交于 2019-12-01 17:04:01
问题 I'm writing a .NET 4 application that imports and saves images for printing. It's important that the saved images resolution (DPI not pixel dimensions) be set to the value we specify so they print correctly. Some of the images we import come without the resolution value (bad EXIF when they were generated), so we have to correct that before writing them. We use Bitmap.SetResolution for that. It works fine on XP and Windows 8, but when we write (Bitmap.Save) the images on Windows 7, they are

Why are my dialog boxes too small on some (but not all) Windows7 computers?

ε祈祈猫儿з 提交于 2019-12-01 16:43:02
I'm starting to test a Winforms (using VS2008) app on Windows 7, and am seeing a strange problem. It ran fine on the first couple of Win7 installations, but on the next two, many of my dialogs are too small, clipping the content by about 30%. The app was developed on WinXP, and have not seen this problem on any of the XP installations! Just starting to investigate the problem - don't have any details on differences between the systems that work and those that don't yet. Edit According to Kate's comment to one of the answers, Win7 will sometimes change to a custom text size when a new monitor

那些恶心人的Screen基本概念

孤人 提交于 2019-12-01 13:38:32
Screen的这些基本概念中,最重要的就是dip的理解,而理解dip就是理解android适配不同设备的关键。 Screen Size 实际物理尺寸。就是我们常说的3.5英寸屏幕,4.7英寸屏幕等等,这个长度说的是对角线的长度。在android中屏幕物理尺寸划分为这么几类:small,normal,large,extra large。 下面是对尺寸以及密度的一个粗略分类。该图可能会由于实际设备尺寸和屏幕密度的不断增加而更新,最新的请到 官网 查看。 图1 Resolution “屏幕”分辨率,即屏幕上的像素总数。 常用的表现形式如:1280x720, 1920x1080等。 Screen density 屏幕密度,与dpi表达的同一个意思,两种不同的描述方式。官网如是说: Screen density The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots per inch) . For example, a "low" density screen has fewer pixels within a given physical area, compared to a "normal" or "high" density screen. public

Storing DPI and Paper Size information in a JPEG with Java

谁说胖子不能爱 提交于 2019-12-01 09:42:14
I have the following code: ImageIO.write(originalImage, OUTPUT_TYPE, resultOutput); This is an invocation of the following javax.imageio.ImageIO method: public static boolean write(RenderedImage im, String formatName, File output) throws IOException This turns an original BMP image into a JGP output. Is it possible to also store DPI and Paper Size information in the JPEG to aid in printing operations? Abdur Rahman Luckily, the java image I/O API lets you do just that. It also allows for setting the image metadata in a format-independent way. For example to specify the desired DPI, which was