Java Utililty Methods Pixel Convert From

List of utility methods to do Pixel Convert From

Description

The list of methods to do Pixel Convert From are organized into topic(s).

Method

floattoPixel(byte b)
to Pixel
int unsigned = (int) b & 0xff;
return toPixelFromByte(unsigned);
floattoPixel(float meter)
to Pixel
return (float) meter * BOX_TO_WORLD;
StringtoPixel(String value)
to Pixel
String ret = value;
if (value.startsWith("@")) {
} else {
    if (value.contains("px")) {
        ret = value.replace("px", "");
    } else if (value.contains("dp")) {
        ret = value.replace("dp", "");
    } else if (value.contains("dip")) {
...
bytetoPixelByte(float floatValue)
to Pixel Byte
return (byte) (floatValue * (Byte.MAX_VALUE - Byte.MIN_VALUE) + Byte.MIN_VALUE);
floattoPixelFromByte(int byteValue)
to Pixel From Byte
return normalize(byteValue, 0, 255);
inttoPixelLength(float number)
to Pixel Length
return (int) (number * 16);
floattoPixelPosY(float posY)
to Pixel Pos Y
float y = HEIGHT - (1.0f * HEIGHT) * posY / 100.0f;
return y;
floattoPixelWidth(float width)
to Pixel Width
return WIDTH * width / 100.0f;