List of utility methods to do Pixel Convert To
float | pixel2logical_size(float l, float zoom) Translates the specified screen length into the logical length. return l / zoom;
|
short | pixel2WidthUnits(int pxs) Converts pixel units to Excel width units (one Excel width unit is 1/256th of a character width) short widthUnits = (short) (EXCEL_COLUMN_WIDTH_FACTOR * (pxs / UNIT_OFFSET_LENGTH)); widthUnits += UNIT_OFFSET_MAP[(pxs % UNIT_OFFSET_LENGTH)]; return widthUnits; |
double | pixels2angle(double pixels) Converts a value from pixels to visual angle on the standard display. return rad2deg(Math.atan2(pixels / pixelsPerInch, viewingDistance));
|
float[][] | pixels2Molecules(float[] pixels, int width, int height) pixels Molecules float[][] mols = new float[width][height - 1]; for (int i = 0; i < (height - 1); i++) { for (int j = 0; j < width; j++) { mols[j][i] = pixels[j + (i + 1) * width]; return mols; |
float | pixelsToCm(float pixels) pixels To Cm return (pixels / DPI) * (1 / 0.393700787f);
|
double | pixelsToInches(int sizeInPixels, int dpi) pixels To Inches int sizeInInches = sizeInPixels / dpi; return sizeInInches; |
int | pixelsToPoint(int pixels, int dpi) pixels To Point int ret = (int) Math.round((pixels * 72.0) / dpi); return ret; |
float | PixelsToPoints(float value, int dpi) Pixels To Points return value / dpi * 72;
|
double | pixelsToYears(double dim, int chartWidth, int firstChartYear, int lastChartYear) Performs the inverse of yearsToPixels. return dim * 1 / yearsToPixels(chartWidth, firstChartYear, lastChartYear);
|
int | pixelToEmu(int pixels, int dpi) pixel To Emu if (dpi <= 0) { dpi = 96; return pixels * (int) ((float) 914400 / dpi); |