Java Pixel Convert To pixelToEmu(int pixels, int dpi)

Here you can find the source of pixelToEmu(int pixels, int dpi)

Description

pixel To Emu

License

Open Source License

Declaration

public static int pixelToEmu(int pixels, int dpi) 

Method Source Code

//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);

    }
}

Related

  1. pixelsToCm(float pixels)
  2. pixelsToInches(int sizeInPixels, int dpi)
  3. pixelsToPoint(int pixels, int dpi)
  4. PixelsToPoints(float value, int dpi)
  5. pixelsToYears(double dim, int chartWidth, int firstChartYear, int lastChartYear)
  6. pixelToRGB(int pixel, int[] prgb)
  7. pixelXYToTileXY(int pixelX, int pixelY)