dpi

Get screen DPI in react native

我们两清 提交于 2020-08-05 08:06:46
问题 Context: I am trying to create an app that is able to use real world dimensions. In my particular case, it is OK if it's not 100% accurate; however, the more accurate the better. For example: If I am trying to display a 3cm wide square and in actuality I display a 2.8cm wide square, that is acceptable. Problem: While there appears to be ways to get a screen's width & height in pixels, there is no way to get either the screen DPI or the screen's width & height in cm/in. My Question: How can I

Programmatically change image resolution

╄→гoц情女王★ 提交于 2020-07-16 16:38:32
问题 I have calculated that if I want my generated image to be A4 size @ 600dpi for print purpose, it needs to be 7016x4961px @ 72dpi. So, I generate it programmatically, then test it in Photoshop and it seems to be fine so if I resize it, it gets proper size and resolution . What I wonder about is if it's possible to make this resizing programmatically, preferably with PIL, but not necessarily with it. I need to make it higher DPI. 回答1: If you have generated your image 7016 x 4961 px, it is

Reducing the size of pdf figure file in matplotlib

六眼飞鱼酱① 提交于 2020-06-07 21:43:53
问题 In matplotlib , I am using LineCollection to draw and color the countries, where the boundaries of the counties are given. When I am saving the figure as a pdf file: fig.savefig('filename.pdf',dpi=300) the figure size are quite big. However, on saving them as png file: fig.savefig('filename.png',dpi=300) and then converting them to pdf using linux convert command the files are small. I tried reducing the dpi, however that do not change the pdf file size. Is there a way the figures can be

Reducing the size of pdf figure file in matplotlib

笑着哭i 提交于 2020-06-07 21:36:12
问题 In matplotlib , I am using LineCollection to draw and color the countries, where the boundaries of the counties are given. When I am saving the figure as a pdf file: fig.savefig('filename.pdf',dpi=300) the figure size are quite big. However, on saving them as png file: fig.savefig('filename.png',dpi=300) and then converting them to pdf using linux convert command the files are small. I tried reducing the dpi, however that do not change the pdf file size. Is there a way the figures can be

Reducing the size of pdf figure file in matplotlib

梦想的初衷 提交于 2020-06-07 21:36:07
问题 In matplotlib , I am using LineCollection to draw and color the countries, where the boundaries of the counties are given. When I am saving the figure as a pdf file: fig.savefig('filename.pdf',dpi=300) the figure size are quite big. However, on saving them as png file: fig.savefig('filename.png',dpi=300) and then converting them to pdf using linux convert command the files are small. I tried reducing the dpi, however that do not change the pdf file size. Is there a way the figures can be

QT_AUTO_SCREEN_SCALE_FACTOR has no effect

天涯浪子 提交于 2020-05-25 19:58:48
问题 My software runs on Windows 7 and up and was developed with 100% dpi scaling (Control Panel > Make text and other items larger or smaller) with Qt 5.8. When my users have their dpi scaling set to something like 150%, all the text and layout spacing increases in size, as they should, but EVERYTHING ELSE is untouched. The result is a broken GUI with text way too big for the other elements. I've researched as much as I could and the "simple fix" is to set the environment variable QT_AUTO_SCREEN

Android中px dpi dip density densityDpi 的相关说明

不问归期 提交于 2020-04-06 22:35:59
概念解释 名词 解释 Px (Pixel像素) 不同设备显示效果相同。这里的“相同”是指像素数不会变,比如指定UI长度是100px,那不管分辨率是多少UI长度都是100px。也正是因为如此才造成了UI在小分辨率设备上被放大而失真,在大分辨率上被缩小。 Screen Size (屏幕尺寸) 一般所说的手机屏幕大小如1.6英寸、1.9英寸、2.2英寸,都是指的对角线的长度,而不是手机面积。我们可以根据勾股定理获取手机的宽和长,当然还有面积。 Resolution (分辨率) 指手机屏幕垂直和水平方向上的像素个数。比如分辨率是480*320,则指设备垂直方向有480个像素点,水平方向有320个像素点。 Dpi (dots per inch 像素密度) 指每英寸中的像素数。如160dpi指手机水平或垂直方向上每英寸距离有160个像素点。假定设备分辨率为320*240,屏幕长2英寸宽1.5英寸,dpi=320/2=240/1.5=160 注意:该值对应于 DisplayMetrics 类中属性 densityDpi 的值。具体请参考 http://www.cnblogs.com/wader2011/archive/2011/11/28/2266669.html Density (密度) 指每平方英寸中的像素数。 Density=Resolution/Screen size 注意:在