dpi

Java / Swing how to deal with different screen DPI and density settings?

ぃ、小莉子 提交于 2019-12-09 18:29:31
问题 Hi everyone I've recently come across the problem that now days some monitors have different DPI settings, some monitors are much more dense such as, for example, Apple's Retina displays. How would one compensate for the different DPI settings and densities on various monitors with Java? Is it possible to scale the controls to be the same size on any monitor. I know when programming for Android all measurements are in "DP" and you can specify different images for three different display

RenderTargetBitmap renders image of a wrong size

喜夏-厌秋 提交于 2019-12-09 18:22:31
问题 My task is to show the user a thumbnail of each page of his XPS document. I need all the images to be small, so I render them with dpi set to 72.0 (I have googled that size of an A4 sheet with dpi 72.0 is 635x896). Basically, I do the following: List<BitmapImage> thumbnails = new List<BitmapImage>(); documentPaginator.ComputePageCount(); int pageCount = documentPaginator.PageCount; for (int i = 0; i < pageCount; i++) { DocumentPage documentPage = documentPaginator.GetPage(i); bool isLandscape

Programmatically determine DPI via the browser?

老子叫甜甜 提交于 2019-12-09 07:57:01
问题 I would like to programmaticaly determine the DPI of a user's display in order to show a web page at a precise number of units (centimeters/inches). I know it a weird request: it's for a visualization research project and it's kind of a control. We currently do it by having the user place a credit card to the screen and match a resizable div (via Mootools) to the real credit card, and voila we can get the DPI and display the page correctly. Can anyone think of a programmatic way to do this?

getheight() px or dpi?

眉间皱痕 提交于 2019-12-09 05:17:44
问题 Help.I found the height of ListView and I do not know px or dpi? I need dpi final ListView actualListView = mPullRefreshListView.getRefreshableView(); actualListView.getViewTreeObserver().addOnGlobalLayoutListener( new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { height = actualListView.getHeight(); } }); 回答1: getheight return height in pixels , Below is what docs says.. public final int getHeight () Since: API Level 1 Return the height of your view. Returns The

Android Nexus 7 DPI for Eclipse

谁都会走 提交于 2019-12-08 17:06:00
问题 The Nexus 7 is that TVDPI, but that is not used in programming apps for it. Eclipse uses the HDPI, LDPI, MDPI, XHDPI, and XXHDPI folders. After my research, I still have found no solid conclusion. Four different sources, four different answers: 1.33 x MDPI HDPI XHDPI No direct answer So my question: Does anyone really know which density (HDPI/LDPI/MDPI/XHDPI/XXHDPI) the Nexus 7 uses? 回答1: The Nexus 7 is that TVDPI, but that is not used in programming apps for it. It certainly can be. You are

How to Get DPI of Image in C#

爷,独闯天下 提交于 2019-12-08 15:46:35
问题 how can i get dpi of an image using asp.net c# 回答1: How about Image.HorizontalResolution and Image.VerticalResolution ? Like this: System.Drawing.Image image = System.Drawing.Image.FromFile("TestImage.bmp"); var dpiX = image.HorizontalResolution; var dpiY = image.VerticalResolution; 回答2: The answer is stated in this post, which sources it's code from here: using System; using System.Drawing; namespace BitmapDpi { class Program { static void Main(string[] args) { Bitmap bmp = new Bitmap(

Android Changing densityDPI in java

二次信任 提交于 2019-12-08 13:02:43
问题 Dose any one know how to change the densityDpi for an android app in java? I'm working on an android application where i manipulate the target density in the viewpoint tag. This is causing a minor problem in some place of the apps, the target density seems to be reset by the soft keyboard. So I need a way to reset this, or prevent the keyboard from changing the density. 回答1: For devices like the lenovo A1 (tablet with 240dpi density) or the galaxy note you may need to do this in your app to

Different sized images (with the same name) in one drawable folder

懵懂的女人 提交于 2019-12-08 05:45:37
问题 I'm new to android programming and every single somewhat-similar question is from three or so years ago and doesn't really answer my question. Android Studio used to have different drawable folders for different dpi. Now there is only one. So if I have two images with the same name but for different dpi, where do I add them so that during runtime the phone can use the appropriate image? Also, most android phones now are xhdpi or xxhdpi--do I really need to include any images less than that?

html5手机端屏幕缩放标签viewport

为君一笑 提交于 2019-12-08 02:14:04
随着高端手机(Andriod,Iphone,Ipod,WinPhone等)的盛行,移动互联应用开发也越来越受到人们的重视,用html5开发移动应用是最好的选择。然而,每一款手机有不同的分辨率,不同屏幕大小,如何使我们开发出来的应用或页面大小能适合各种高端手机使用呢?学习html5 viewport的使用能帮你做到这一点…… viewport 语法介绍: 01 <!-- html document --> 02 < meta name = "viewport" 03 content = " 04 height = [pixel_value | device-height] , 05 width = [pixel_value | device-width ] , 06 initial-scale = float_value , 07 minimum-scale = float_value , 08 maximum-scale = float_value , 09 user-scalable = [yes | no] , 10 target-densitydpi = [dpi_value | device-dpi | high-dpi | medium-dpi | low-dpi] 11 " 12 /> width 控制 viewport 的大小,可以指定的一个值或者特殊的值,如

移动端viewport

耗尽温柔 提交于 2019-12-08 02:11:22
前言 对于移动webapp开发人员来说,viewport是个很重要的东西,容易用但很多时候都是不明白的,于是我决心去弄清楚它。 < meta name = "viewport" content = "width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" > viewport涉及的单位 分辨率:指设备显示器所能显示的像素有多少 物理分辨率:指设备显示器所能显示最高的像素数 DPI (Dots Per Inch):每英寸的点数密度 PPI(Pixels Per Inch):每英寸的像素点 DIP/DP(device independent pixels): 设备独立像素, 这个由设备硬件决定。 devicePixelRatio : 设备像素比 ( window.devicePixelRatio = 物理分辨率 / dip ) PS:在计算机或移动屏幕中提到ppi和dpi其实都一样, 越高的PPI所呈现的内容越清晰。 什么是viewport? 其实手机浏览器装载页面是放在一个中间件里面的,而这个中间件就是viewport。(起初是ios提出的,后来android借用了) viewport重要概念 1.可视区(visual area) :