Here you can find the source of pixelToEmu(int pixels, int dpi)
public static int pixelToEmu(int pixels, int dpi)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Actuate Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from www .j av a 2 s . com*/ * Actuate Corporation - initial API and implementation *******************************************************************************/ public class Main { public static int pixelToEmu(int pixels, int dpi) { if (dpi <= 0) {// default resolution: dpi = 96; } return pixels * (int) ((float) 914400 / dpi); } }