|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.androidplot.util.PixelUtils
public class PixelUtils
Field Summary | |
---|---|
static Map<String,Integer> |
dimensionConstantLookup
CODE BELOW IS ADAPTED IN PART FROM MINDRIOT'S SAMPLE CODE HERE: http://stackoverflow.com/questions/8343971/how-to-parse-a-dimension-string-and-convert-it-to-a-dimension-value |
Constructor Summary | |
---|---|
PixelUtils()
|
Method Summary | |
---|---|
static android.graphics.PointF |
add(android.graphics.PointF lhs,
android.graphics.PointF rhs)
|
static float |
dpToPix(float dp)
Converts a dp value to pixels. |
static float |
fractionToPixH(float fraction)
|
static float |
fractionToPixW(float fraction)
|
static void |
init(android.content.Context ctx)
Recalculates scale value etc. |
static android.graphics.RectF |
nearestPixRect(float left,
float top,
float right,
float bottom)
|
static android.graphics.RectF |
sink(android.graphics.RectF in)
Converts a sub-pixel accurate RectF to a single pixel accurate rect. |
static float |
spToPix(float sp)
Converts an sp value to pixels. |
static float |
stringToDimension(String dimension)
|
static android.graphics.PointF |
sub(android.graphics.PointF lhs,
android.graphics.PointF rhs)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Map<String,Integer> dimensionConstantLookup
Constructor Detail |
---|
public PixelUtils()
Method Detail |
---|
public static void init(android.content.Context ctx)
public static android.graphics.PointF add(android.graphics.PointF lhs, android.graphics.PointF rhs)
public static android.graphics.PointF sub(android.graphics.PointF lhs, android.graphics.PointF rhs)
public static android.graphics.RectF sink(android.graphics.RectF in)
in
-
public static android.graphics.RectF nearestPixRect(float left, float top, float right, float bottom)
public static float dpToPix(float dp)
dp
-
public static float spToPix(float sp)
sp
-
public static float fractionToPixH(float fraction)
fraction
- A float value between 0 and 1.
public static float fractionToPixW(float fraction)
fraction
- A float value between 0 and 1.
public static float stringToDimension(String dimension)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |