-
public abstract class GraphicOverlay.Graphic
-
-
Constructor Summary
Constructors Constructor Description GraphicOverlay.Graphic(GraphicOverlay overlay)
-
Method Summary
Modifier and Type Method Description abstract voiddraw(Canvas canvas)Draw the graphic on the supplied canvas. intpreviewWidth()intpreviewHeight()floatgetWidthScaleFactor()floatgetHeightScaleFactor()floatscaleX(float horizontal)Adjusts a horizontal value of the supplied value from the preview scale to the view scale. floatscaleY(float vertical)Adjusts a vertical value of the supplied value from the preview scale to the view scale. ContextgetApplicationContext()Returns the application context of the app. floattranslateX(float x)Adjusts the x coordinate from the preview's coordinate system to the view coordinate system. floattranslateX2(float y)Adjusts the x coordinate from the preview's coordinate system to the view coordinate system. floattranslateX3(float y)floattranslateY(float y)Adjusts the y coordinate from the preview's coordinate system to the view coordinate system. floattranslateY2(float x)Adjusts the y coordinate from the preview's coordinate system to the view coordinate system. floattranslateY3(float x)voidpostInvalidate()-
-
Constructor Detail
-
GraphicOverlay.Graphic
GraphicOverlay.Graphic(GraphicOverlay overlay)
-
-
Method Detail
-
draw
abstract void draw(Canvas canvas)
Draw the graphic on the supplied canvas. Drawing should use the following methods to convertto view coordinates for the graphics that are drawn:
- scaleX and scaleY adjust the size of thesupplied value from the preview scale to the view scale.
- translateX and translateY adjust thecoordinate from the preview's coordinate system to the view coordinate system.
- Parameters:
canvas- drawing canvas
-
previewWidth
int previewWidth()
-
previewHeight
int previewHeight()
-
getWidthScaleFactor
float getWidthScaleFactor()
-
getHeightScaleFactor
float getHeightScaleFactor()
-
scaleX
float scaleX(float horizontal)
Adjusts a horizontal value of the supplied value from the preview scale to the view scale.
-
scaleY
float scaleY(float vertical)
Adjusts a vertical value of the supplied value from the preview scale to the view scale.
-
getApplicationContext
Context getApplicationContext()
Returns the application context of the app.
-
translateX
float translateX(float x)
Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.
-
translateX2
float translateX2(float y)
Adjusts the x coordinate from the preview's coordinate system to the view coordinate system.
-
translateX3
float translateX3(float y)
-
translateY
float translateY(float y)
Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.
-
translateY2
float translateY2(float x)
Adjusts the y coordinate from the preview's coordinate system to the view coordinate system.
-
translateY3
float translateY3(float x)
-
postInvalidate
void postInvalidate()
-
-
-
-