dpi

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

回眸只為那壹抹淺笑 提交于 2019-12-17 11:55:35
问题 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

How to read the physical screen size of OSX?

最后都变了- 提交于 2019-12-17 10:43:29
问题 I would like to know the physical screen size under Mac OSX. But NSDeviceResolution is always reporting wrong value (72), so the calculation result of resolution / dpi is wrong. Inside "About This Mac", there is a Mac model string there, mine is "15-inch, Early 2011". So I'm wondering should there be a way (in obj-c probably), to read that string and then I can use that as the physical screen size. Any help is appreciated. 回答1: You can use CGDisplayScreenSize to get the physical size of a

What's the correct size icon for drawable-xxhdpi?

孤街浪徒 提交于 2019-12-17 10:09:53
问题 As we know, the correct sized icon: * drawable-ldpi (120 dpi, Low density screen) - 36px x 36px * drawable-mdpi (160 dpi, Medium density screen) - 48px x 48px * drawable-hdpi (240 dpi, High density screen) - 72px x 72px * drawable-xhdpi (320 dpi, Extra-high density screen) - 96px x 96px On Jelly Bean, drawable-xxhdpi can be supported. So what's the correct size icon? 回答1: MDPI: 48x48 HDPI: 72x72 XHDPI: 96x96 XXHDPI: 144x144 XXXHDPI: 192x192 to create an icon for different densities, you

C# WinForms disable DPI scaling

送分小仙女□ 提交于 2019-12-17 09:52:01
问题 I have a WinForm application which hosts many images. When I put the application on a Win7 machines that has a DPI of 120, it completely ruins the look of the form. Is there a way to disable the scaling for my form? I am aware that this is something that is not advised and that DPI should be seamless and handled by the OS. But when it comes to a skinned application, the images do not scale well. I do not have the luxury of creating images for all the DPI variations, so please don't suggest

对屏幕的理解---分辨率,dpi,ppi,屏幕尺寸,像素 等

孤街浪徒 提交于 2019-12-17 05:12:47
1. 名词理解 屏幕尺寸(screen size)    屏幕尺寸(screen size) ,是屏幕的对角线长度,一般讲的大小单位都是英寸。 DPI (dots per inch)   dpi 是(英文Dots Per Inch)(每英寸所打印的点数)的缩写,是打印机、鼠标等设备分辨率的单位。国际上都是计算 一平方英寸面积内像素的多少 。这是衡量 打印机打印精度 的主要参数之一,一般来说, 该值越大,表明打印机的打印精度越高 。如果对于扫描设备,dpi越大,则采样点越高,扫描的图片越清晰。   可以理解为 像素的密度 ,即单位面长度上的所打印点的数量。 PPI (pixels per inch)   PPI (pixels per inch)(每英寸的像素数量)的缩写 像素(Pixel) (1)对于数字图像来说    简单的说,我们通常所说的像素,就是CCD/CMOS上光电感应元件的数量,一个感光元件经过感光,光电信号转换,A/D转换等步骤以后,在输出的照片上就形成一个点,我们如果把影像放大数倍,会发现这些连续色调其实是由许多色彩相近的小方点所组成,这些小方点就是构成影像的最小单位 “像素”(Pixel) 。如果这些感光点的是彩色像素点,把一个数字图像方法到一定程度,可以看到一个个像素点,如下图所示:    (2)对于硬件显示设备来说   对于计算机的屏幕设备而言,像素

How can I get the DPI in WPF?

戏子无情 提交于 2019-12-17 02:45:08
问题 How can I get the DPI in WPF? 回答1: http://blogs.msdn.com/jaimer/archive/2007/03/07/getting-system-dpi-in-wpf-app.aspx seems to work PresentationSource source = PresentationSource.FromVisual(this); double dpiX, dpiY; if (source != null) { dpiX = 96.0 * source.CompositionTarget.TransformToDevice.M11; dpiY = 96.0 * source.CompositionTarget.TransformToDevice.M22; } 回答2: var dpiXProperty = typeof(SystemParameters).GetProperty("DpiX", BindingFlags.NonPublic | BindingFlags.Static); var dpiYProperty

Scaling ImageButtons for various screen sizes

别说谁变了你拦得住时间么 提交于 2019-12-14 03:26:00
问题 For my app (runs Android 2.1 and above), I was wondering how to scale buttons for various screen sizes (virtual emulators in this case) in terms of dpi, because my scaled background images seem to be "unpixelated" perfectly fine... I scaled my button ("GOT IT" as shown below) accordingly with say, an lpdi and a xxhdpi screen, and I get the following results: For the Nexus 5 virtual emulator (xxhdpi), button supposedly at 150X34 pixels which seems to navigate to the ldpi resource director

High DPI scaling, mouse hooks and WindowFromPoint

随声附和 提交于 2019-12-13 23:01:07
问题 I have a process that sets a SetWindowsHookEx(WH_MOUSE_LL, , ,) right click hook. My process is set to DPI system aware on Window 10.0.10586 at 150% scaling on both monitors. This was set by calling SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE). My problem scenario is e.g. Office 2007 is DPI unaware, so let's place MS Word on the right quarter of the screen. Right click just above the task bar in the bottom right and the mouse hook sends coordinates of 1279, 675 - scaled to Word. Then I

Write higher resolution (DPI) Images to PDF

最后都变了- 提交于 2019-12-13 18:42:06
问题 I have seen code to extract the images based on image DPI using PDFBox like below PDDocument document = PDDocument.load(path); PDFImageWriter writer = new PDFImageWriter(); boolean success = writer.writeImage(document, "jpg", "", 1, 1, "C:\\Image Quality\\150", BufferedImage.TYPE_INT_RGB, 150); return document; In above code I can specify the image resolution(150) while extracting the image from pdf. With higher resolution I get larger image in return. Now I want reverse of it means to

Retrieve Image Resolution(DPI) of an image (JPEG,PNG,SVG,GIF) without using any PHP extension

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 07:14:09
问题 I want to Retrieve Image Resolution(DPI) of an image (JPEG,PNG,SVG,GIF) without using any PHP extension (like imageMagick). I searched everywhere, but I couldn't find a perfect solution. I tried below code (got from link) 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)); } But I am not getting the correct Horizontal and vertical