dpi

说明位图,矢量图,像素,分辨率,PPI,DPI?

只谈情不闲聊 提交于 2019-12-05 19:35:56
说明位图,矢量图,像素,分辨率,PPI,DPI? 显示全部 关注者 28 被浏览 7,031 关注问题 写回答 ​邀请回答 ​添加评论 ​分享 ​ 2 个回答 默认排序 刘凯 21 人赞同了该回答 位图:位图图像(bitmap), 亦称为点阵图像或绘制图像,是由称作像素(图片元素)的单个点组成的。这些点可以进行不同的排列和染色以构成图样。当放大位图时,可以看见赖以构成整个图像的无数单个方块。只要有足够多的不同色彩的像素,就可以制作出色彩丰富的图象,逼真地表现自然界的景象。缩放和旋转容易失真,同时文件容量较大。bmp,jpg,gif,png。便携式网络图形(Portable Network Graphics,PNG)是一种无损压缩的位图图形格式,截图首选png格式。 矢量图像:由数学向量组成,文件容量较小,在进行放大、缩小或旋转等操作时图象不会失真,缺点是不易制作色彩变化太多的图象。 像素:像素,又称画素,为图像显示的基本单位,译自英文“pixel”,pix是英语单词picture的常用简写,加上英语单词“元素”element,就得到pixel,故“像素”表示“图像元素”之意。像素表示图形尺寸的大小。不同设备显示效果相同。这里的“相同”是指像素数不会变,比如指定UI长度是100px,那不管分辨率是多少UI长度都是100px。也正是因为如此才造成了UI在小分辨率设备上被放大而失真

Same DPI but different inch size

北城余情 提交于 2019-12-05 18:21:14
I know the Internet is overwhelmed with questions about DPI px inches and so on. But after several hours of googling my situation doesnt seem to happen to anyone else! I have 2 devices custom build with android studio which are both mdpi. BUT one device is 3.65inch and the other device is an 10.1 inch. I have created a folder with 2 images 250x125 with the dpi set to 160 dpi If normally I would declare my 2 images in my XML with dp units instead of pixels...I would suppose on both screens the result should be the same right ? Well it seems the images keep remaining the same size and don't look

SetWindowPos() cross-process DPI aware

*爱你&永不变心* 提交于 2019-12-05 14:31:42
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 have tried to do is Get the DPI of the monitor where the window is placed as screenDPI . Get the DPI of

Transform Screen.PrimaryScreen.WorkingArea to WPF dimensions at higher DPI settings

僤鯓⒐⒋嵵緔 提交于 2019-12-05 12:19:08
I have the following function in my WPF application that I use to resize a window to the primary screen's working area (the whole screen minus the taskbar): private void Window_Loaded(object sender, RoutedEventArgs e) { int theHeight = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height; int theWidth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width; this.MaxHeight = theHeight; this.MinHeight = theHeight; this.MaxWidth = theWidth; this.MinWidth = theWidth; this.Height = theHeight; this.Width = theWidth; this.Top = 0; this.Left = 0; } This works very well, as long as the

适配方案(四)适配的基础知识之单位、分辨率、viewport

雨燕双飞 提交于 2019-12-05 09:56:06
适配的基础知识 一、理解单位 px、pt、pc、sp、em、rem、dpr、dp、dip、ppi、dpi、ldpi、mdpi、hdpi、xhdpi、xxhdpi 如果你是ios开发,你需要了解的单位:pt,px,ppi;实际开发中用到的单位:pt。 如果你是android开发,你需要了解的单位:dip/dp,sp,px,dpi/ppi,ldpi,mdpi,hdpi,xhdpi,xxhdpi;实际开发中用到的单位:dp,sp。 如果你是前端开发,你需要了解的单位:px,em,rem,dpr;实际开发中用到的单位:px,em,rem,dpr 1、dpi / ppi dpi:dot per inch ,每英寸的点数;打印或印刷领域使用的单位,代表打印机每英寸可以打印出的点数 。 ppi:pixel per inch ,每英寸的像素数,像素密度;表示图像或者显示器单位面积上像素数量。 dpi 和 ppi 都是描述分辨率的单位,但是两者是有区别的,但是在描述手机分辨率时,可以认为两者意义相同,以前android设备偏向于使用 dpi ,ios设备偏向于使用 ppi ,目前android和ios统一使用 ppi 描述手机屏幕的像素显示密度。 2、ldpi、mdpi、hdpi、xhdpi、xxhdpi android对移动设备不同屏幕分辨率的分类 3、pt,pc,sp pt:磅(point的音译

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

时光总嘲笑我的痴心妄想 提交于 2019-12-05 09:53:29
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, 1.25, 0, 0); Width *= 1.25; Height *= 1.25; // Bring window center screen var screenHeight = System

QT 如何支持高清屏,视网膜屏幕

我的梦境 提交于 2019-12-05 06:23:46
Mac OS、iOS和X11的Retina显示支持 Published 星期四 五月 2nd, 2013 | by Liang Qi 原文链接: Morten Johan Sørvig – Retina display support for Mac OS, iOS and X11 Qt 5.0中添加了对于 retina 显示的基本支持。即将到来的Qt 5.1中提供了新的API和缺陷修复,对于这一问题进行了改进。Qt 4.8也获得了良好的支持,我们 反向移植 了一些Qt 5的补丁。 尽管这些实现的努力和Mac以及iOS程序员最为相关,但是来看一看其它平台是如何处理高DPI显示这一问题,也是很有趣的。这里主要有两种方式: 基于DPI缩放 —— Win32 GDI 和 KDE 。在这种方式中,应用程序在全物理设备分辨率下工作,使用系统提供的一个DPI设定或者缩放因子,用于缩放布局。字体通常会被操作系统自动缩放(只要您使用点数(point)而不是像素(pixel)来指定字体大小) 另一种意义的像素 。在这种方式中,应用程序并不知道物理解析度(在任何程度上)。物理像素被逻辑像素替代: 平台/API 逻辑的 物理的 HTML CSS像素 设备像素 Apple 点 像素 Android 密度无关像素(dp) (屏幕)像素 Direct2D 设备无关像素(DIP) 物理像素 Qt(过去) 像素

Qt Mac OS、iOS和X11的Retina显示支持

回眸只為那壹抹淺笑 提交于 2019-12-05 06:23:36
Mac OS、iOS和X11的Retina显示支持 Published 星期四 五月 2nd, 2013 | by Liang Qi 原文链接: Morten Johan Sørvig – Retina display support for Mac OS, iOS and X11 Qt 5.0中添加了对于 retina 显示的基本支持。即将到来的Qt 5.1中提供了新的API和缺陷修复,对于这一问题进行了改进。Qt 4.8也获得了良好的支持,我们 反向移植 了一些Qt 5的补丁。 尽管这些实现的努力和Mac以及iOS程序员最为相关,但是来看一看其它平台是如何处理高DPI显示这一问题,也是很有趣的。这里主要有两种方式: 基于DPI缩放 —— Win32 GDI 和 KDE 。在这种方式中,应用程序在全物理设备分辨率下工作,使用系统提供的一个DPI设定或者缩放因子,用于缩放布局。字体通常会被操作系统自动缩放(只要您使用点数(point)而不是像素(pixel)来指定字体大小) 另一种意义的像素 。在这种方式中,应用程序并不知道物理解析度(在任何程度上)。物理像素被逻辑像素替代: 平台/API 逻辑的 物理的 HTML CSS像素 设备像素 Apple 点 像素 Android 密度无关像素(dp) (屏幕)像素 Direct2D 设备无关像素(DIP) 物理像素 Qt(过去) 像素

How to get screen DPI (linux,mac) programatically?

喜你入骨 提交于 2019-12-04 20:15:03
问题 I need to know active screen DPI on Linux and Mac OS. I think on linux xlib might be useful, but I can't find a way how to get currect DPI. I want this information to get real screen size in inches. Thanks in advance! 回答1: In X on Linux, call XOpenDisplay() to get the Display , then use DisplayWidthMM() and DisplayHeightMM() together with DisplayWidth() and DisplayHeight() to compute the DPI. On the Mac, there's almost certainly a more native API to use than X. Mac OS X does not run X Window

android屏幕密度dpi

南楼画角 提交于 2019-12-04 15:43:29
假设一台android设备屏幕像素为a*b px,屏幕大小为 c 英寸。 则dpi=sqrt(a*a+b*b)/c; android以dpi=160的屏幕作为标准,规定对于这种屏幕,1dp=1px; 所以dp和px的换算公式为,dpvalue=pxvalue/(dpi/160); 来源: https://www.cnblogs.com/cloud-zzy/p/11871930.html