Press on the image to return to the main documentation page.
AcceleratedSurface
Written by F. Leneuf-Magaud
List of types:
AcceleratedSurface
AS_Canvas
AS_ImageUtils
AS_Object
AS_Path
AS_Text
AS_Texture
AcceleratedSurface
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.
Events:
Draw(AC As AS_Canvas)
Touch(Action As Int, X As Int, Y As Int, Event As Object)
Update(ElapsedTime As Long)
Members:
Background
As
android
.
graphics
.
drawable
.
Drawable
Bitmap
As
BitmapWrapper
[read
only]
BringToFront
Color
As
Int
[write
only]
ElapsedTimeSinceLastDraw
As
Long
Enabled
As
Boolean
Height
As
Int
Initialize
(
EventPrefix
As
String
,
IsHardwareAccelerated
As
Boolean
)
Invalidate
Invalidate2
(
arg0
As
android
.
graphics
.
Rect
)
Invalidate3
(
arg0
As
Int
,
arg1
As
Int
,
arg2
As
Int
,
arg3
As
Int
)
IsHardwareAccelerated
As
Boolean
[read
only]
IsInitialized
As
Boolean
Left
As
Int
RemoveView
RequestFocus
As
Boolean
SendToBack
SetBackgroundImage
(
arg0
As
android
.
graphics
.
Bitmap
)
SetLayout
(
arg0
As
Int
,
arg1
As
Int
,
arg2
As
Int
,
arg3
As
Int
)
StartRegularDraw
(
Interval
As
Int
)
StartRegularUpdateAndDraw
(
Interval
As
Int
)
StopRegularDraw
Tag
As
Object
Top
As
Int
Visible
As
Boolean
Width
As
Int
Members description:
Background
As
android
.
graphics
.
drawable
.
Drawable
Bitmap
As
BitmapWrapper
[read
only]
Returns a screenshot of the current contents of the view.
BringToFront
Color
As
Int
[write
only]
ElapsedTimeSinceLastDraw
As
Long
Gets the elapsed time (in milliseconds) since the last Draw event.
Returns always 0 if StartRegularDraw was not called.
Enabled
As
Boolean
Height
As
Int
Initialize
(
EventPrefix
As
String
,
IsHardwareAccelerated
As
Boolean
)
Initializes the accelerated surface.
IsHardwareAccelerated: This setting should be set to true to benefit from the hardware acceleration.
It is ignored by Android versions prior to Honeycomb (3.0, API 11).
Invalidate
Invalidate2
(
arg0
As
android
.
graphics
.
Rect
)
Invalidate3
(
arg0
As
Int
,
arg1
As
Int
,
arg2
As
Int
,
arg3
As
Int
)
IsHardwareAccelerated
As
Boolean
[read
only]
Gets whether the view is hardware accelerated.
If the view is not hardware accelerated under Android 3 or +, check that you set IsHardwareAccelerated
to true in Initialize and that you added SetApplicationAttribute(android:hardwareAccelerated, "true")
to the manifest.
IsInitialized
As
Boolean
Left
As
Int
RemoveView
RequestFocus
As
Boolean
SendToBack
SetBackgroundImage
(
arg0
As
android
.
graphics
.
Bitmap
)
SetLayout
(
arg0
As
Int
,
arg1
As
Int
,
arg2
As
Int
,
arg3
As
Int
)
StartRegularDraw
(
Interval
As
Int
)
Fires automatically the Draw event at regular intervals (in milliseconds).
This function will attempt to honor the requested interval, but the actual delay
between Draw events may be different, depending on system load and capabilities.
StartRegularUpdateAndDraw
(
Interval
As
Int
)
Fires automatically an Update event and a Draw event at regular intervals (in milliseconds).
This function will attempt to honor the requested interval, but the actual delay
between events may be different, depending on system load and capabilities.
StopRegularDraw
Stops the timer started with StartRegularDraw or StartRegularUpdateAndDraw.
Tag
As
Object
Top
As
Int
Visible
As
Boolean
Width
As
Int
AS_Canvas
Events:
None
Members:
ALIGN_CENTER
As
android
.
graphics
.
Paint
.
Align
ALIGN_LEFT
As
android
.
graphics
.
Paint
.
Align
ALIGN_RIGHT
As
android
.
graphics
.
Paint
.
Align
CameraComputeMatrix
CameraRestore
CameraRotateX
(
deg
As
Float
)
CameraRotateY
(
deg
As
Float
)
CameraRotateZ
(
deg
As
Float
)
CameraSave
CameraSetLocation
(
x
As
Float
,
y
As
Float
,
z
As
Float
)
CameraTranslate
(
x
As
Float
,
y
As
Float
,
z
As
Float
)
ClipPath
(
Path
As
Object
)
ClipRect
(
Rect
As
RectWrapper
)
CreateLayer
(
LayerRect
As
RectWrapper
)
As
Int
DrawArc
(
OvalRect
As
RectWrapper
,
StartAngle
As
Float
,
SweepAngle
As
Float
,
Wedge
As
Boolean
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
DrawBitmap
(
Bmp
As
BitmapWrapper
,
SrcRect
As
android
.
graphics
.
Rect
,
DestRect
As
android
.
graphics
.
Rect
)
DrawBitmapAt
(
Bmp
As
BitmapWrapper
,
Left
As
Int
,
Top
As
Int
)
DrawBitmapMesh
(
Bmp
As
BitmapWrapper
,
MeshWidth
As
Int
,
MeshHeight
As
Int
,
Verts
()
As
Float
,
VertOffset
As
Int
)
DrawBitmapObjectWithMatrixAt
(
objBmp
As
AS_Object
,
Left
As
Int
,
Top
As
Int
)
DrawBitmapWithMatrixAt
(
Bmp
As
BitmapWrapper
,
Left
As
Int
,
Top
As
Int
,
Filter
As
Boolean
)
DrawCircle
(
x
As
Float
,
y
As
Float
,
Radius
As
Float
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
DrawColor
(
Color
As
Int
)
DrawDrawable
(
drawable
As
android
.
graphics
.
drawable
.
Drawable
,
DestRect
As
RectWrapper
)
DrawLine
(
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
,
Color
As
Int
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
DrawObjectAt
(
Obj
As
AS_Object
,
X
As
Float
,
Y
As
Float
)
DrawOval
(
Rect
As
RectWrapper
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
DrawPath
(
Path
As
Object
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
DrawPoint
(
x
As
Float
,
y
As
Float
,
Color
As
Int
)
DrawRect
(
Rect
As
RectWrapper
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
DrawRoundRect
(
Rect
As
RectWrapper
,
Color
As
Int
,
CornerRadius
As
Float
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
DrawText
(
Text
As
String
,
x
As
Float
,
y
As
Float
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
,
Color
As
Int
,
Align
As
android
.
graphics
.
Paint
.
Align
)
DrawTextObject
(
objText
As
AS_Text
,
Text
As
String
,
X
As
Float
,
Y
As
Float
,
Align
As
android
.
graphics
.
Paint
.
Align
)
DrawTextOnPath
(
Text
As
String
,
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
,
x3
As
Float
,
y3
As
Float
,
x4
As
Float
,
y4
As
Float
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
,
Color
As
Int
,
Align
As
android
.
graphics
.
Paint
.
Align
)
ImportCamera
(
c
As
android
.
graphics
.
Camera
)
ImportMatrix
(
m
As
android
.
graphics
.
Matrix
)
MatrixPostRotate
(
degrees
As
Float
)
MatrixPostRotate2
(
degrees
As
Float
,
px
As
Float
,
py
As
Float
)
MatrixPostScale
(
sx
As
Float
,
sy
As
Float
)
MatrixPostSkew
(
sx
As
Float
,
sy
As
Float
)
MatrixPostTranslate
(
dx
As
Float
,
dy
As
Float
)
MatrixSetRotate
(
degrees
As
Float
)
As
AS_Canvas
MatrixSetRotate2
(
degrees
As
Float
,
px
As
Float
,
py
As
Float
)
As
AS_Canvas
MatrixSetScale
(
sx
As
Float
,
sy
As
Float
)
As
AS_Canvas
MatrixSetSinCos
(
sinValue
As
Float
,
cosValue
As
Float
,
px
As
Float
,
py
As
Float
)
As
AS_Canvas
MatrixSetSkew
(
sx
As
Float
,
sy
As
Float
)
As
AS_Canvas
MatrixSetSkew2
(
sx
As
Float
,
sy
As
Float
,
px
As
Float
,
py
As
Float
)
As
AS_Canvas
MatrixSetTranslate
(
dx
As
Float
,
dy
As
Float
)
As
AS_Canvas
MeasureStringHeight
(
Text
As
String
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
)
As
Int
MeasureStringWidth
(
Text
As
String
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
)
As
Float
RemoveClip
RestoreState
RotateCanvas
(
Degrees
As
Float
)
RotateCanvasAround
(
Degrees
As
Float
,
PivotX
As
Float
,
PivotY
As
Float
)
SaveState
ScaleCanvas
(
ScaleX
As
Float
,
ScaleY
As
Float
)
SkewCanvas
(
SkewX
As
Float
,
SkewY
As
Float
)
TransferLayer
TranslateCanvas
(
dX
As
Float
,
dY
As
Float
)
Members description:
ALIGN_CENTER
As
android
.
graphics
.
Paint
.
Align
ALIGN_LEFT
As
android
.
graphics
.
Paint
.
Align
ALIGN_RIGHT
As
android
.
graphics
.
Paint
.
Align
CameraComputeMatrix
Computes the matrix corresponding to the current transformation and copies it to the internal matrix.
CameraRestore
Restores the saved state, if any.
CameraRotateX
(
deg
As
Float
)
Applies a rotation transform around the X axis.
deg: The angle of rotation around the X axis, in degrees
CameraRotateY
(
deg
As
Float
)
Applies a rotation transform around the Y axis.
deg: The angle of rotation around the Y axis, in degrees
CameraRotateZ
(
deg
As
Float
)
Applies a rotation transform around the Z axis.
deg: The angle of rotation around the Z axis, in degrees
CameraSave
Saves the camera state. Each Save should be balanced with a call to Restore.
CameraSetLocation
(
x
As
Float
,
y
As
Float
,
z
As
Float
)
Sets the location of the camera. The default location is set at 0, 0, -8.
x: The x location of the camera
y: The y location of the camera
z: The z location of the camera
minSDK=12
CameraTranslate
(
x
As
Float
,
y
As
Float
,
z
As
Float
)
Applies a translation transform on all three axis.
x: The distance to translate by on the X axis
y: The distance to translate by on the Y axis
z: The distance to translate by on the Z axis
ClipPath
(
Path
As
Object
)
Clips the drawing area to the given path. The path may be an instance of the Path class or an instance of the AS_Path class.
Warning: This does not work if the hardware acceleration is enabled.
ClipRect
(
Rect
As
RectWrapper
)
Clips the drawing area to the given rectangle.
CreateLayer
(
LayerRect
As
RectWrapper
)
As
Int
Redirects all subsequent drawings in a separate layer until you call TransferLayer.
LayerRect: Rectangular coordinates of the layer.
DrawArc
(
OvalRect
As
RectWrapper
,
StartAngle
As
Float
,
SweepAngle
As
Float
,
Wedge
As
Boolean
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
Draws the specified arc, which will be scaled to fit inside the specified oval.
OvalRect: The bounds of oval used to define the shape and size of the arc.
StartAngle: Starting angle (in degrees) where the arc begins.
SweepAngle: Sweep angle (in degrees) measured clockwise.
Wedge: Whether the center of the oval closes the arc to draw a wedge.
Filled: Whether the arc will be filled.
StrokeWidth: The stroke width. Relevant when Filled = False.
Filter: Whether the edges are smoothed out.
DrawBitmap
(
Bmp
As
BitmapWrapper
,
SrcRect
As
android
.
graphics
.
Rect
,
DestRect
As
android
.
graphics
.
Rect
)
Draws the given bitmap.
SrcRect: The subset of the bitmap that will be drawn. If Null then the complete bitmap will be drawn.
DestRect: The rectangle that the bitmap will be drawn into.
DrawBitmapAt
(
Bmp
As
BitmapWrapper
,
Left
As
Int
,
Top
As
Int
)
Draws the given bitmap at the specified position.
DrawBitmapMesh
(
Bmp
As
BitmapWrapper
,
MeshWidth
As
Int
,
MeshHeight
As
Int
,
Verts
()
As
Float
,
VertOffset
As
Int
)
Draws the given bitmap through a mesh.
The mesh vertices are evenly distributed across the bitmap. There are MeshWidth+1 vertices across, and MeshHeight+1 vertices down. The Verts array is accessed in row-major order, so that the first MeshWidth+1 vertices are distributed across the top of the bitmap from left to right.
MeshWidth: The number of columns in the mesh. Nothing is drawn if this is 0.
MeshHeight: The number of rows in the mesh. Nothing is drawn if this is 0.
Verts: Array of x,y pairs, specifying where the mesh should be drawn. There must be at least (MeshWidth+1)*(MeshHeight+1)*2+VertOffset values in the array.
VertOffset: Number of Verts elements to skip before drawing.
DrawBitmapObjectWithMatrixAt
(
objBmp
As
AS_Object
,
Left
As
Int
,
Top
As
Int
)
Transforms the given bitmap object with the internal matrix and draws it at the specified position.
DrawBitmapWithMatrixAt
(
Bmp
As
BitmapWrapper
,
Left
As
Int
,
Top
As
Int
,
Filter
As
Boolean
)
Transforms the given bitmap with the internal matrix and draws it at the specified position.
Filter: Filtering affects the sampling of the bitmap when it is transformed. True = best quality.
DrawCircle
(
x
As
Float
,
y
As
Float
,
Radius
As
Float
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
Draws a circle.
x: The x-coordinate of the center of the circle to be drawn.
y: The y-coordinate of the center of the circle to be drawn.
Radius: The radius of the circle to be drawn.
Filled: Whether the circle will be filled.
StrokeWidth: The stroke width. Relevant when Filled = False.
Filter: Whether the edges are smoothed out.
DrawColor
(
Color
As
Int
)
Fills the entire canvas with the given color.
DrawDrawable
(
drawable
As
android
.
graphics
.
drawable
.
Drawable
,
DestRect
As
RectWrapper
)
Draws a Drawable into the specified rectangle.
DrawLine
(
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
,
Color
As
Int
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
Draws a line from (x1, y1) to (x2, y2).
StrokeWidth: Width of the line.
Filter: Whether the edges are smoothed out.
DrawObjectAt
(
Obj
As
AS_Object
,
X
As
Float
,
Y
As
Float
)
Draws an AS_Object.
X,Y: For circles, X and Y define the position of the centre. For other objects, they define the position of the upper left corner.
DrawOval
(
Rect
As
RectWrapper
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
Draws an oval shape.
Rect: The rectangle bounds of the oval to be drawn.
Filled: Whether the oval will be filled.
StrokeWidth: The stroke width. Relevant when Filled = False.
Filter: Whether the edges are smoothed out.
DrawPath
(
Path
As
Object
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
Draws the given path.
Path: The path to be drawn. It may be an instance of the Path class or an instance of the AS_Path class.
Filled: Whether the shape bounded by the path will be filled.
StrokeWidth: The stroke width. Relevant when Filled = False.
Filter: Whether the edges are smoothed out.
DrawPoint
(
x
As
Float
,
y
As
Float
,
Color
As
Int
)
Draws a point at the specified position and color.
DrawRect
(
Rect
As
RectWrapper
,
Color
As
Int
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
Draws a rectangle.
Rect: The coordinates of the rectangle to be drawn.
Filled: Whether the rectangle will be filled.
StrokeWidth: The stroke width. Relevant when Filled = False.
Filter: Whether the edges are smoothed out.
DrawRoundRect
(
Rect
As
RectWrapper
,
Color
As
Int
,
CornerRadius
As
Float
,
Filled
As
Boolean
,
StrokeWidth
As
Float
,
Filter
As
Boolean
)
Draws a rectangle with rounded corners.
Rect: The coordinates of the round-rect to be drawn.
CornerRadius: The radius of the oval used to round the corners.
Filled: Whether the round-rect will be filled.
StrokeWidth: The stroke width. Relevant when Filled = False.
Filter: Whether the edges are smoothed out.
DrawText
(
Text
As
String
,
x
As
Float
,
y
As
Float
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
,
Color
As
Int
,
Align
As
android
.
graphics
.
Paint
.
Align
)
Draws the text.
Text: The text to be drawn.
x,y: The origin point.
Typeface: Typeface (font) to use.
TextSize: Size of text. This value is automatically scaled so do not scale it yourself.
Align: The alignment related to the origin. One of the ALIGN constants.
DrawTextObject
(
objText
As
AS_Text
,
Text
As
String
,
X
As
Float
,
Y
As
Float
,
Align
As
android
.
graphics
.
Paint
.
Align
)
Draws an AS_Text object.
Text: The text to be drawn.
X,Y: The origin point.
Align: The alignment related to the origin. One of the ALIGN constants.
DrawTextOnPath
(
Text
As
String
,
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
,
x3
As
Float
,
y3
As
Float
,
x4
As
Float
,
y4
As
Float
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
,
Color
As
Int
,
Align
As
android
.
graphics
.
Paint
.
Align
)
Draws the text along the specified path.
Warning: This does not work under Honeycomb or ICS if the hardware acceleration is enabled.
Text: The text to be drawn.
x1,y1: The coordinates of the start point.
x2,y2,x3,y3: The coordinates of the intermediate points.
x4,y4: The coordinates of the end point.
Typeface: Typeface (font) to use.
TextSize: Size of text. This value is automatically scaled so do not scale it yourself.
Align: The alignment related to the origin. One of the ALIGN constants.
ImportCamera
(
c
As
android
.
graphics
.
Camera
)
Imports a Camera from another library.
ImportMatrix
(
m
As
android
.
graphics
.
Matrix
)
Imports a Matrix from another library.
MatrixPostRotate
(
degrees
As
Float
)
Postconcats the internal matrix with the specified rotation.
MatrixPostRotate2
(
degrees
As
Float
,
px
As
Float
,
py
As
Float
)
Postconcats the internal matrix with the specified rotation.
px,py: The coordinates of the pivot point.
MatrixPostScale
(
sx
As
Float
,
sy
As
Float
)
Postconcats the internal matrix with the specified scale.
MatrixPostSkew
(
sx
As
Float
,
sy
As
Float
)
Postconcats the internal matrix with the specified skew.
MatrixPostTranslate
(
dx
As
Float
,
dy
As
Float
)
Postconcats the internal matrix with the specified translation.
MatrixSetRotate
(
degrees
As
Float
)
As
AS_Canvas
Sets the internal matrix to rotate around (0,0) by the specified number of degrees.
MatrixSetRotate2
(
degrees
As
Float
,
px
As
Float
,
py
As
Float
)
As
AS_Canvas
Sets the internal matrix to rotate by the specified number of degrees, with a pivot point at (px, py).
MatrixSetScale
(
sx
As
Float
,
sy
As
Float
)
As
AS_Canvas
Sets the internal matrix to scale by sx and sy.
MatrixSetSinCos
(
sinValue
As
Float
,
cosValue
As
Float
,
px
As
Float
,
py
As
Float
)
As
AS_Canvas
Sets the internal matrix to rotate by the specified sine and cosine values, with a pivot point at (px, py).
The pivot point is the coordinate that should remain unchanged by the specified transformation.
MatrixSetSkew
(
sx
As
Float
,
sy
As
Float
)
As
AS_Canvas
Sets the internal matrix to skew by sx and sy.
MatrixSetSkew2
(
sx
As
Float
,
sy
As
Float
,
px
As
Float
,
py
As
Float
)
As
AS_Canvas
Sets the internal matrix to skew by sx and sy, with a pivot point at (px, py).
MatrixSetTranslate
(
dx
As
Float
,
dy
As
Float
)
As
AS_Canvas
Sets the internal matrix to translate by (dx, dy).
MeasureStringHeight
(
Text
As
String
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
)
As
Int
Returns the height of the given text.
MeasureStringWidth
(
Text
As
String
,
Typeface
As
TypefaceWrapper
,
TextSize
As
Float
)
As
Float
Returns the width of the given text.
RemoveClip
Removes the clipping set by ClipPath or ClipRect.
RestoreState
Restores the canvas state saved with SaveState.
Undoes the following functions called after SaveState:
RotateCanvas, RotateCanvasAround, ScaleCanvas, SkewCanvas, TranslateCanvas, ClipPath, and ClipRect.
The drawings stay unchanged.
RotateCanvas
(
Degrees
As
Float
)
Rotates all subsequent drawings around the canvas center by the specified number of degrees.
RotateCanvasAround
(
Degrees
As
Float
,
PivotX
As
Float
,
PivotY
As
Float
)
Rotates all subsequent drawings around the pivot coordinates by the specified number of degrees.
SaveState
Saves the current state of the canvas. Each SaveState should be balanced with a call to RestoreState.
In this example of rotation, only the rectangle is rotated:
AC.SaveState
AC.RotateCanvas(45)
AC.DrawRect(rctRect, Colors.Red, True, 0, True)
AC.RestoreState
AC.DrawOval(rctOval, Colors.Blue, True, 0, True)
ScaleCanvas
(
ScaleX
As
Float
,
ScaleY
As
Float
)
Scales all subsequent drawings by ScaleX, ScaleY.
SkewCanvas
(
SkewX
As
Float
,
SkewY
As
Float
)
Skews all subsequent drawings by SkewX, SkewY.
TransferLayer
Transfers the layer to the canvas and deletes it.
TranslateCanvas
(
dX
As
Float
,
dY
As
Float
)
Translates all subsequent drawings by dX, dY.
AS_ImageUtils
Events:
None
Members:
AlterColors
(
srcBmp
As
BitmapWrapper
,
Alpha
As
Int
,
Hue
As
Int
,
Saturation
As
Float
)
As
android
.
graphics
.
Bitmap
CreateScaledBitmap
(
srcBmp
As
BitmapWrapper
,
dstWidth
As
Int
,
dstHeight
As
Int
,
filter
As
Boolean
)
As
android
.
graphics
.
Bitmap
Crop
(
srcBmp
As
BitmapWrapper
,
x
As
Int
,
y
As
Int
,
width
As
Int
,
height
As
Int
)
As
android
.
graphics
.
Bitmap
GetDensity
(
srcBmp
As
BitmapWrapper
)
As
Int
GetImageDimensions
(
Dir
As
String
,
FileName
As
String
)
As
Map
GetPixels
(
src
As
BitmapWrapper
,
Pixels
()
As
Int
,
offset
As
Int
,
stride
As
Int
,
x
As
Int
,
y
As
Int
,
width
As
Int
,
height
As
Int
)
LoadNinePatchDrawable
(
Name
As
String
)
As
android
.
graphics
.
drawable
.
Drawable
LoadScaledBitmap
(
Dir
As
String
,
FileName
As
String
,
dstWidth
As
Int
,
dstHeight
As
Int
,
Filter
As
Boolean
)
As
android
.
graphics
.
Bitmap
LoadSystemDrawable
(
Name
As
String
)
As
android
.
graphics
.
drawable
.
Drawable
MakeMutable
(
srcBmp
As
BitmapWrapper
)
As
android
.
graphics
.
Bitmap
ReduceColors
(
srcBmp
As
BitmapWrapper
)
As
android
.
graphics
.
Bitmap
SetDensity
(
srcBmp
As
BitmapWrapper
,
Density
As
Int
)
Members description:
AlterColors
(
srcBmp
As
BitmapWrapper
,
Alpha
As
Int
,
Hue
As
Int
,
Saturation
As
Float
)
As
android
.
graphics
.
Bitmap
Changes the transparency, hue and saturation of the given bitmap, and returns the result.
The bitmap must be mutable.
Alpha: From -1 to 255. -1 = no change, 0 = transparent, 255 = opaque.
Hue: From 0 to 360. 0 or 360 = no change.
Saturation: 0 = gray-scale, 1 = no change.
CreateScaledBitmap
(
srcBmp
As
BitmapWrapper
,
dstWidth
As
Int
,
dstHeight
As
Int
,
filter
As
Boolean
)
As
android
.
graphics
.
Bitmap
Creates a new bitmap scaled from an existing bitmap.
If the specified width and height are the same as the current width and height of the source bitmap, the source bitmap is returned and no new bitmap is created.
srcBmp: The source bitmap.
dstWidth: The new bitmap's desired width.
dstHeight: The new bitmap's desired height.
filter: True if the source should be filtered.
Crop
(
srcBmp
As
BitmapWrapper
,
x
As
Int
,
y
As
Int
,
width
As
Int
,
height
As
Int
)
As
android
.
graphics
.
Bitmap
Creates a new bitmap by removing the outer parts of another one.
srcBmp: The source bitmap.
x,y: Coordinates of the cropping rectangle.
width,height: Size of the cropping rectangle.
GetDensity
(
srcBmp
As
BitmapWrapper
)
As
Int
Gets the density of the given bitmap.
GetImageDimensions
(
Dir
As
String
,
FileName
As
String
)
As
Map
Returns a Map containing the dimensions of the given image (keys = "height" and "width").
The image is not loaded in memory.
This function does not work with images in the assets folder.
GetPixels
(
src
As
BitmapWrapper
,
Pixels
()
As
Int
,
offset
As
Int
,
stride
As
Int
,
x
As
Int
,
y
As
Int
,
width
As
Int
,
height
As
Int
)
Returns in Pixels() a copy of the data in the bitmap. Each value is a packed int representing a Color.
The stride parameter allows the caller to allow for gaps in the returned pixels array between rows.
For normal packed results, just pass width for the stride value.
Pixels: The array to receive the bitmap's colors
offset: The first index to write into Pixels()
stride: The number of entries in Pixels() to skip between rows (must be >= bitmap's width). Can be negative.
x: The x coordinate of the first pixel to read from the bitmap
y: The y coordinate of the first pixel to read from the bitmap
width: The number of pixels to read from each row
height: The number of rows to read
LoadNinePatchDrawable
(
Name
As
String
)
As
android
.
graphics
.
drawable
.
Drawable
Gets a 9-patch drawable from the application resources.
LoadScaledBitmap
(
Dir
As
String
,
FileName
As
String
,
dstWidth
As
Int
,
dstHeight
As
Int
,
Filter
As
Boolean
)
As
android
.
graphics
.
Bitmap
Loads and rescales a bitmap.
dstWidth: The new bitmap's desired width or -1 to keep the original width.
dstHeight: The new bitmap's desired height or -1 to keep the original height.
Filter: If True, improves the sampling quality.
LoadSystemDrawable
(
Name
As
String
)
As
android
.
graphics
.
drawable
.
Drawable
Gets a drawable from the Android system resources.
MakeMutable
(
srcBmp
As
BitmapWrapper
)
As
android
.
graphics
.
Bitmap
Returns a mutable bitmap from an immutable one.
ReduceColors
(
srcBmp
As
BitmapWrapper
)
As
android
.
graphics
.
Bitmap
Converts a bitmap from the format ARGB_8888 to the format RGB_565 to save memory.
The returned bitmap is mutable.
SetDensity
(
srcBmp
As
BitmapWrapper
,
Density
As
Int
)
Changes the density of the given bitmap.
AS_Object
Events:
None
Members:
AddToPathEffect
(
Effect
As
Int
,
Value
As
Float
,
Combine
As
Boolean
)
As
AS_Object
ChangeArcAngles
(
StartAngle
As
Float
,
SweepAngle
As
Float
)
ChangeBitmap
(
SrcBmp
As
BitmapWrapper
)
ChangeCircleRadius
(
Radius
As
Float
)
ChangePath
(
Path
As
Object
)
ChangeWidthHeight
(
Width
As
Int
,
Height
As
Int
)
Clone
(
ObjToCopy
As
AS_Object
)
As
AS_Object
CreateArc
(
Width
As
Int
,
Height
As
Int
,
StartAngle
As
Float
,
SweepAngle
As
Float
,
Wedge
As
Boolean
,
Filter
As
Boolean
)
As
AS_Object
CreateBitmap
(
SrcBmp
As
BitmapWrapper
,
Filter
As
Boolean
)
As
AS_Object
CreateBitmap2
(
SrcBmp
As
BitmapWrapper
,
SrcRect
As
android
.
graphics
.
Rect
,
Width
As
Int
,
Height
As
Int
,
Filter
As
Boolean
)
As
AS_Object
CreateCircle
(
Radius
As
Float
,
Filter
As
Boolean
)
As
AS_Object
CreateLine
(
DeltaX
As
Float
,
DeltaY
As
Float
,
Filter
As
Boolean
)
As
AS_Object
CreateOval
(
Width
As
Int
,
Height
As
Int
,
Filter
As
Boolean
)
As
AS_Object
CreatePath
(
Path
As
Object
,
Filter
As
Boolean
)
As
AS_Object
CreatePoint
As
AS_Object
CreateRect
(
Width
As
Int
,
Height
As
Int
,
Filter
As
Boolean
)
As
AS_Object
CreateRoundRect
(
Width
As
Int
,
Height
As
Int
,
CornerRadiusX
As
Float
,
CornerRadiusY
As
Float
,
Filter
As
Boolean
)
As
AS_Object
GetAlpha
As
Int
GetColor
As
Int
GetHeight
As
Int
GetWidth
As
Int
IsInitialized
As
Boolean
[read
only]
MODE_CLEAR
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DARKEN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_LIGHTEN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_MULTIPLY
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SCREEN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_XOR
As
android
.
graphics
.
PorterDuff
.
Mode
Paint
As
android
.
graphics
.
Paint
PATHEFFECT_CLEAR
As
Int
PATHEFFECT_DASH_ALTERNATE
As
Int
PATHEFFECT_DASH_REGULAR
As
Int
PATHEFFECT_DASH_SEGMENTED
As
Int
PATHEFFECT_DISTORTED
As
Int
PATHEFFECT_ROUNDED
As
Int
PATHEFFECT_STYLE_MORPH
As
android
.
graphics
.
PathDashPathEffect
.
Style
PATHEFFECT_STYLE_ROTATE
As
android
.
graphics
.
PathDashPathEffect
.
Style
PATHEFFECT_STYLE_TRANSLATE
As
android
.
graphics
.
PathDashPathEffect
.
Style
SetAlpha
(
Alpha
As
Int
)
SetColor
(
Color
As
Int
)
As
AS_Object
SetLightingColorFilter
(
Multiply
As
Int
,
Add
As
Int
)
As
AS_Object
SetPathEffect
(
Effect
As
Int
,
Value
As
Float
)
As
AS_Object
SetPathEffect2
(
Shape
As
Object
,
Spacing
As
Float
,
Style
As
android
.
graphics
.
PathDashPathEffect
.
Style
)
As
AS_Object
SetPorterDuffColorFilter
(
SrcColor
As
Int
,
PDMode
As
android
.
graphics
.
PorterDuff
.
Mode
)
As
AS_Object
SetStyle
(
style
As
android
.
graphics
.
Paint
.
Style
,
StrokeWidth
As
Int
)
As
AS_Object
SetTexture
(
texture
As
AS_Texture
)
As
AS_Object
SetXferMode
(
PDMode
As
android
.
graphics
.
PorterDuff
.
Mode
)
As
AS_Object
STYLE_FILL
As
android
.
graphics
.
Paint
.
Style
STYLE_FILL_AND_STROKE
As
android
.
graphics
.
Paint
.
Style
STYLE_STROKE
As
android
.
graphics
.
Paint
.
Style
Members description:
AddToPathEffect
(
Effect
As
Int
,
Value
As
Float
,
Combine
As
Boolean
)
As
AS_Object
Adds a patheffect to the current patheffect. This only affects drawing with a style set to STROKE or FILL_AND_STROKE.
Effect: One of the PATHEFFECT constants.
Value: Value of the effect (for dash effects, it defines the dash size and interval).
Combine: If True, the two effects are combined. Otherwise they are just superimposed.
ChangeArcAngles
(
StartAngle
As
Float
,
SweepAngle
As
Float
)
Changes the angles of an arc object.
StartAngle: Starting angle (in degrees) where the arc begins.
SweepAngle: Sweep angle (in degrees) measured clockwise.
ChangeBitmap
(
SrcBmp
As
BitmapWrapper
)
Replaces the bitmap of a bitmap object.
ChangeCircleRadius
(
Radius
As
Float
)
Changes the radius of a circle object.
ChangePath
(
Path
As
Object
)
Changes the path of a path object.
ChangeWidthHeight
(
Width
As
Int
,
Height
As
Int
)
Changes the width and height of an object (if it has such properties).
Clone
(
ObjToCopy
As
AS_Object
)
As
AS_Object
Clones an existing AS_Object.
CreateArc
(
Width
As
Int
,
Height
As
Int
,
StartAngle
As
Float
,
SweepAngle
As
Float
,
Wedge
As
Boolean
,
Filter
As
Boolean
)
As
AS_Object
Creates an arc object.
Width,Height: Size of the oval used to define the shape and size of the arc.
StartAngle: Starting angle (in degrees) where the arc begins.
SweepAngle: Sweep angle (in degrees) measured clockwise.
Wedge: Whether the center of the oval closes the arc to draw a wedge.
Filter: Whether the edges are smoothed out.
CreateBitmap
(
SrcBmp
As
BitmapWrapper
,
Filter
As
Boolean
)
As
AS_Object
Creates a bitmap object.
Filter: Filtering affects the sampling of bitmaps when they are rescaled. True = best quality.
CreateBitmap2
(
SrcBmp
As
BitmapWrapper
,
SrcRect
As
android
.
graphics
.
Rect
,
Width
As
Int
,
Height
As
Int
,
Filter
As
Boolean
)
As
AS_Object
Creates a bitmap object.
SrcRect: The subset of the bitmap that will be drawn. If Null then the complete bitmap will be drawn.
Width,Height: Size of the rectangle that the bitmap will be drawn into.
Filter: Filtering affects the sampling of bitmaps when they are rescaled. True = best quality.
CreateCircle
(
Radius
As
Float
,
Filter
As
Boolean
)
As
AS_Object
Creates a circle object.
Radius: The radius of the circle to be drawn.
Filter: Whether the edges are smoothed out.
CreateLine
(
DeltaX
As
Float
,
DeltaY
As
Float
,
Filter
As
Boolean
)
As
AS_Object
Creates a line object
DeltaX,DeltaY: Offsets from the starting position used to calculate the ending position.
Filter: Whether the edges are smoothed out.
CreateOval
(
Width
As
Int
,
Height
As
Int
,
Filter
As
Boolean
)
As
AS_Object
Creates an oval object.
Width,Height: Size of the oval to be drawn.
Filter: Whether the edges are smoothed out.
CreatePath
(
Path
As
Object
,
Filter
As
Boolean
)
As
AS_Object
Creates a path object.
Path: An instance of the Path class or an instance of the AS_Path class.
Filter: Whether the edges are smoothed out.
CreatePoint
As
AS_Object
Creates a point object.
CreateRect
(
Width
As
Int
,
Height
As
Int
,
Filter
As
Boolean
)
As
AS_Object
Creates a rectangle object.
Width,Height: Size of the rectangle to be drawn.
Filter: Whether the edges are smoothed out.
CreateRoundRect
(
Width
As
Int
,
Height
As
Int
,
CornerRadiusX
As
Float
,
CornerRadiusY
As
Float
,
Filter
As
Boolean
)
As
AS_Object
Creates a rectangle object with rounded corners.
Width,Height: Size of the round-rect to be drawn.
CornerRadiusX: The x-radius of the oval used to round the corners.
CornerRadiusY: The y-radius of the oval used to round the corners.
Filter: Whether the edges are smoothed out.
GetAlpha
As
Int
Returns the alpha value of the object color.
GetColor
As
Int
Gets the object color.
GetHeight
As
Int
Gets the height of an object (if it has such a property).
GetWidth
As
Int
Gets the width of an object (if it has such a property).
IsInitialized
As
Boolean
[read
only]
MODE_CLEAR
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DARKEN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_DST_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_LIGHTEN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_MULTIPLY
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SCREEN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_SRC_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MODE_XOR
As
android
.
graphics
.
PorterDuff
.
Mode
Paint
As
android
.
graphics
.
Paint
Gets/sets the internal Paint.
PATHEFFECT_CLEAR
As
Int
PATHEFFECT_DASH_ALTERNATE
As
Int
PATHEFFECT_DASH_REGULAR
As
Int
PATHEFFECT_DASH_SEGMENTED
As
Int
PATHEFFECT_DISTORTED
As
Int
PATHEFFECT_ROUNDED
As
Int
PATHEFFECT_STYLE_MORPH
As
android
.
graphics
.
PathDashPathEffect
.
Style
PATHEFFECT_STYLE_ROTATE
As
android
.
graphics
.
PathDashPathEffect
.
Style
PATHEFFECT_STYLE_TRANSLATE
As
android
.
graphics
.
PathDashPathEffect
.
Style
SetAlpha
(
Alpha
As
Int
)
Sets the alpha value of the object color, leaving its R,G,B values unchanged.
SetColor
(
Color
As
Int
)
As
AS_Object
Paints the object with the given color.
If this function is called after SetTexture, SetTexture is ignored.
SetLightingColorFilter
(
Multiply
As
Int
,
Add
As
Int
)
As
AS_Object
Adds a colorfilter that multiplies the RGB channels by one color, and then adds a second color,
pinning the result for each component to [0..255].
If this function is called after SetPorterDuffColorFilter, SetPorterDuffColorFilter is ignored.
SetPathEffect
(
Effect
As
Int
,
Value
As
Float
)
As
AS_Object
Sets a patheffect. This only affects drawing with a style set to STROKE or FILL_AND_STROKE.
Effect: One of the PATHEFFECT constants.
Value: Value of the effect (for dash effects, it defines the dash size and interval).
SetPathEffect2
(
Shape
As
Object
,
Spacing
As
Float
,
Style
As
android
.
graphics
.
PathDashPathEffect
.
Style
)
As
AS_Object
Stamps the contour of the object with the specified shape. This only applies to drawings with a style set to STROKE or FILL_AND_STROKE.
Shape: An instance of the Path class or an instance of the AS_Path class.
Spacing: Spacing between each stamp of shape.
Style: How to transform the shape at each position as it is stamped. One of the PATHEFFECT_STYLE constants.
SetPorterDuffColorFilter
(
SrcColor
As
Int
,
PDMode
As
android
.
graphics
.
PorterDuff
.
Mode
)
As
AS_Object
Adds a colorfilter that uses the specified color and Porter-Duff mode.
Warning: some modes may have a different result depending on whether the hardware acceleration is enabled or not.
If this function is called after SetLightingColorFilter, SetLightingColorFilter is ignored.
PDMode: One of the MODE constants or Null.
SetStyle
(
style
As
android
.
graphics
.
Paint
.
Style
,
StrokeWidth
As
Int
)
As
AS_Object
Defines whether the object will be filled or stroked, or both.
Style: One of the STYLE constants.
StrokeWidth: The stroke width. Relevant when Style <> STYLE_FILL.
SetTexture
(
texture
As
AS_Texture
)
As
AS_Object
Paints the object with the given texture.
If this function is called after SetColor, SetColor is ignored.
SetXferMode
(
PDMode
As
android
.
graphics
.
PorterDuff
.
Mode
)
As
AS_Object
Adds a transfer-mode in the drawing pipeline that uses the specified Porter-Duff mode.
Warning: some modes may have a different result depending on whether the hardware acceleration is enabled or not.
PDMode: One of the MODE constants or Null.
STYLE_FILL
As
android
.
graphics
.
Paint
.
Style
STYLE_FILL_AND_STROKE
As
android
.
graphics
.
Paint
.
Style
STYLE_STROKE
As
android
.
graphics
.
Paint
.
Style
AS_Path
Events:
None
Members:
AddPath
(
PathToAppend
As
AS_Path
)
As
AS_Path
ArcTo
(
OvalRect
As
RectWrapper
,
StartAngle
As
Float
,
SweepAngle
As
Float
)
As
AS_Path
Close
ComputeBounds
(
rctBounds
As
RectWrapper
)
CubicTo
(
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
,
x3
As
Float
,
y3
As
Float
)
As
AS_Path
FILLTYPE_EVENODD
As
android
.
graphics
.
Path
.
FillType
FILLTYPE_INVERSE_EVENODD
As
android
.
graphics
.
Path
.
FillType
FILLTYPE_INVERSE_WINDING
As
android
.
graphics
.
Path
.
FillType
FILLTYPE_WINDING
As
android
.
graphics
.
Path
.
FillType
ImportPath
(
p
As
android
.
graphics
.
Path
)
Initialize
(
x
As
Float
,
y
As
Float
)
IsInitialized
As
Boolean
[read
only]
LineTo
(
x
As
Float
,
y
As
Float
)
As
AS_Path
MoveTo
(
x
As
Float
,
y
As
Float
)
As
AS_Path
QuadTo
(
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
)
As
AS_Path
rCubicTo
(
dx1
As
Float
,
dy1
As
Float
,
dx2
As
Float
,
dy2
As
Float
,
dx3
As
Float
,
dy3
As
Float
)
As
AS_Path
Reset
rLineTo
(
dx
As
Float
,
dy
As
Float
)
As
AS_Path
rMoveTo
(
dx
As
Float
,
dy
As
Float
)
As
AS_Path
rQuadTo
(
dx1
As
Float
,
dy1
As
Float
,
dx2
As
Float
,
dy2
As
Float
)
As
AS_Path
SetFillType
(
FT
As
android
.
graphics
.
Path
.
FillType
)
As
AS_Path
ToggleInverseFillType
Members description:
AddPath
(
PathToAppend
As
AS_Path
)
As
AS_Path
Adds a copy of the given path to the current path.
ArcTo
(
OvalRect
As
RectWrapper
,
StartAngle
As
Float
,
SweepAngle
As
Float
)
As
AS_Path
Appends the specified arc to the path as a new contour.
An automatic LineTo is added to connect the current contour to the start of the arc.
OvalRect: The bounds of oval used to define the shape and size of the arc.
StartAngle: Starting angle (in degrees) where the arc begins.
SweepAngle: Sweep angle (in degrees) measured clockwise.
Close
Closes the current contour. If the current point is not equal to the first point of the contour, a line segment is automatically added.
ComputeBounds
(
rctBounds
As
RectWrapper
)
Computes the bounds of the control points of the path, and writes the answer into rctBounds.
CubicTo
(
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
,
x3
As
Float
,
y3
As
Float
)
As
AS_Path
Adds a cubic bezier from the last point, approaching control points (x1,y1) and (x2,y2), and ending at (x3,y3).
FILLTYPE_EVENODD
As
android
.
graphics
.
Path
.
FillType
FILLTYPE_INVERSE_EVENODD
As
android
.
graphics
.
Path
.
FillType
FILLTYPE_INVERSE_WINDING
As
android
.
graphics
.
Path
.
FillType
FILLTYPE_WINDING
As
android
.
graphics
.
Path
.
FillType
ImportPath
(
p
As
android
.
graphics
.
Path
)
Imports a Path from another library.
Initialize
(
x
As
Float
,
y
As
Float
)
Initializes the AS_Path object and sets its beginning point to (x,y).
IsInitialized
As
Boolean
[read
only]
LineTo
(
x
As
Float
,
y
As
Float
)
As
AS_Path
Adds a line from the last point to the specified point (x,y).
MoveTo
(
x
As
Float
,
y
As
Float
)
As
AS_Path
Sets the beginning of the next contour to the point (x,y).
QuadTo
(
x1
As
Float
,
y1
As
Float
,
x2
As
Float
,
y2
As
Float
)
As
AS_Path
Adds a quadratic bezier from the last point, approaching control point (x1,y1), and ending at (x2,y2).
rCubicTo
(
dx1
As
Float
,
dy1
As
Float
,
dx2
As
Float
,
dy2
As
Float
,
dx3
As
Float
,
dy3
As
Float
)
As
AS_Path
Same as CubicTo, but the coordinates are considered relative to the current point on this contour.
Reset
Clears any lines and curves from the path, making it empty.
rLineTo
(
dx
As
Float
,
dy
As
Float
)
As
AS_Path
Same as LineTo, but the coordinates are considered relative to the last point on this contour.
rMoveTo
(
dx
As
Float
,
dy
As
Float
)
As
AS_Path
Sets the beginning of the next contour relative to the last point on the previous contour.
rQuadTo
(
dx1
As
Float
,
dy1
As
Float
,
dx2
As
Float
,
dy2
As
Float
)
As
AS_Path
Same as QuadTo, but the coordinates are considered relative to the last point on this contour.
SetFillType
(
FT
As
android
.
graphics
.
Path
.
FillType
)
As
AS_Path
Sets the path's fill type.
FT: One of the FILLTYPE constants.
ToggleInverseFillType
Toggles the INVERSE state of the fill type.
AS_Text
Events:
None
Members:
Clone
(
ObjToCopy
As
AS_Text
)
As
AS_Text
CreateText
(
Typeface
As
TypefaceWrapper
,
Filter
As
Boolean
)
As
AS_Text
GetAlpha
As
Int
GetColor
As
Int
GetSize
As
Float
IsInitialized
As
Boolean
[read
only]
MeasureStringHeight
(
Text
As
String
)
As
Int
MeasureStringWidth
(
Text
As
String
)
As
Float
Paint
As
android
.
graphics
.
Paint
ReplaceTypeface
(
NewTypeface
As
TypefaceWrapper
)
SetAlpha
(
Alpha
As
Int
)
SetBold
(
Enabled
As
Boolean
)
As
AS_Text
SetColor
(
Color
As
Int
)
As
AS_Text
SetLightingColorFilter
(
Multiply
As
Int
,
Add
As
Int
)
As
AS_Text
SetPath
(
Path
As
Object
)
As
AS_Text
SetScaleX
(
ScaleX
As
Float
)
As
AS_Text
SetShadow
(
dX
As
Float
,
dY
As
Float
,
Radius
As
Float
,
Color
As
Int
)
As
AS_Text
SetSize
(
TextSize
As
Float
)
As
AS_Text
SetSkewX
(
SkewX
As
Float
)
As
AS_Text
SetStyle
(
style
As
android
.
graphics
.
Paint
.
Style
,
StrokeWidth
As
Int
)
As
AS_Text
SetTexture
(
texture
As
AS_Texture
)
As
AS_Text
SetUnderline
(
Enabled
As
Boolean
)
As
AS_Text
STYLE_FILL
As
android
.
graphics
.
Paint
.
Style
STYLE_FILL_AND_STROKE
As
android
.
graphics
.
Paint
.
Style
STYLE_STROKE
As
android
.
graphics
.
Paint
.
Style
Members description:
Clone
(
ObjToCopy
As
AS_Text
)
As
AS_Text
Clones an existing AS_Text.
CreateText
(
Typeface
As
TypefaceWrapper
,
Filter
As
Boolean
)
As
AS_Text
Creates a text object.
Typeface: Typeface (font) to use.
Filter: Whether the edges are smoothed out.
GetAlpha
As
Int
Returns the alpha value of the text color.
GetColor
As
Int
Gets the text color.
GetSize
As
Float
Gets the text size.
IsInitialized
As
Boolean
[read
only]
MeasureStringHeight
(
Text
As
String
)
As
Int
Returns the height of the given text.
MeasureStringWidth
(
Text
As
String
)
As
Float
Returns the width of the given text.
Paint
As
android
.
graphics
.
Paint
Gets/sets the internal Paint.
ReplaceTypeface
(
NewTypeface
As
TypefaceWrapper
)
Replaces the typeface (font).
SetAlpha
(
Alpha
As
Int
)
Sets the alpha value of the text color, leaving its R,G,B values unchanged.
SetBold
(
Enabled
As
Boolean
)
As
AS_Text
Enables or disables bold text.
SetColor
(
Color
As
Int
)
As
AS_Text
Paints the text with the given color.
If this function is called after SetTexture, SetTexture is ignored.
SetLightingColorFilter
(
Multiply
As
Int
,
Add
As
Int
)
As
AS_Text
Adds a colorfilter that multiplies the RGB channels by one color, and then adds a second color,
pinning the result for each component to [0..255].
SetPath
(
Path
As
Object
)
As
AS_Text
Sets the path along which the text will be drawn.
Warning: Nothing will be drawn under Honeycomb or ICS if the hardware acceleration is enabled.
Path: An instance of the Path class or an instance of the AS_Path class.
SetScaleX
(
ScaleX
As
Float
)
As
AS_Text
Sets the text's horizontal scale factor.
SetShadow
(
dX
As
Float
,
dY
As
Float
,
Radius
As
Float
,
Color
As
Int
)
As
AS_Text
Adds a shadow layer below the main layer, with the specified offset, blur radius and color.
If radius is 0, then the shadow layer is removed.
SetSize
(
TextSize
As
Float
)
As
AS_Text
Sets the text size. This value is automatically scaled so do not scale it yourself.
SetSkewX
(
SkewX
As
Float
)
As
AS_Text
Sets the text's horizontal skew factor.
SetStyle
(
style
As
android
.
graphics
.
Paint
.
Style
,
StrokeWidth
As
Int
)
As
AS_Text
Defines whether the text will be filled or stroked, or both.
Style: One of the STYLE constants.
StrokeWidth: The stroke width. Relevant when Style <> STYLE_FILL.
SetTexture
(
texture
As
AS_Texture
)
As
AS_Text
Paints the text with the given texture.
If this function is called after SetColor, SetColor is ignored.
SetUnderline
(
Enabled
As
Boolean
)
As
AS_Text
Enables or disables underline text.
This may not work as expected depending on the OS version and the chosen style.
STYLE_FILL
As
android
.
graphics
.
Paint
.
Style
STYLE_FILL_AND_STROKE
As
android
.
graphics
.
Paint
.
Style
STYLE_STROKE
As
android
.
graphics
.
Paint
.
Style
AS_Texture
Events:
None
Members:
CreateLinearGradient
(
X0
As
Float
,
Y0
As
Float
,
X1
As
Float
,
Y1
As
Float
,
Colors
()
As
Int
,
TileMode
As
android
.
graphics
.
Shader
.
TileMode
)
As
AS_Texture
CreateRadialGradient
(
X
As
Float
,
Y
As
Float
,
Radius
As
Float
,
Colors
()
As
Int
,
TileMode
As
android
.
graphics
.
Shader
.
TileMode
)
As
AS_Texture
CreateSweepGradient
(
X
As
Float
,
Y
As
Float
,
Colors
()
As
Int
)
As
AS_Texture
CreateWithBitmap
(
Image
As
BitmapWrapper
,
ModeX
As
android
.
graphics
.
Shader
.
TileMode
,
ModeY
As
android
.
graphics
.
Shader
.
TileMode
)
As
AS_Texture
IsInitialized
As
Boolean
[read
only]
Merge
(
Tex1
As
AS_Texture
,
Tex2
As
AS_Texture
,
MergeMode
As
android
.
graphics
.
PorterDuff
.
Mode
)
As
AS_Texture
MERGEMODE_DARKEN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_LIGHTEN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_MULTIPLY
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_SCREEN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_XOR
As
android
.
graphics
.
PorterDuff
.
Mode
TILEMODE_CLAMP
As
android
.
graphics
.
Shader
.
TileMode
TILEMODE_MIRROR
As
android
.
graphics
.
Shader
.
TileMode
TILEMODE_REPEAT
As
android
.
graphics
.
Shader
.
TileMode
Translate
(
OffsetX
As
Int
,
OffsetY
As
Int
)
Members description:
CreateLinearGradient
(
X0
As
Float
,
Y0
As
Float
,
X1
As
Float
,
Y1
As
Float
,
Colors
()
As
Int
,
TileMode
As
android
.
graphics
.
Shader
.
TileMode
)
As
AS_Texture
Creates a texture with a linear gradient. This texture can be repeated or mirrored.
X0: The x-coordinate for the start of the gradient line.
Y0: The y-coordinate for the start of the gradient line.
X1: The x-coordinate for the end of the gradient line.
Y1: The y-coordinate for the end of the gradient line.
Colors: The colors to be distributed along the gradient line. There must be at least 2 colors in the array.
TileMode: one of the TILEMODE constants.
CreateRadialGradient
(
X
As
Float
,
Y
As
Float
,
Radius
As
Float
,
Colors
()
As
Int
,
TileMode
As
android
.
graphics
.
Shader
.
TileMode
)
As
AS_Texture
Creates a texture with a radial gradient. This texture can be repeated or mirrored.
X: The x-coordinate of the center of the circle.
Y: The y-coordinate of the center of the circle.
Radius: Must be positive. The radius of the circle for this gradient.
Colors: The colors to be distributed between the center and edge of the circle. There must be at least 2 colors in the array.
TileMode: one of the TILEMODE constants.
CreateSweepGradient
(
X
As
Float
,
Y
As
Float
,
Colors
()
As
Int
)
As
AS_Texture
Creates a texture with a sweep gradient.
X: The x-coordinate of the center.
Y: The y-coordinate of the center.
Colors: The colors to be distributed around the center. There must be at least 2 colors in the array.
CreateWithBitmap
(
Image
As
BitmapWrapper
,
ModeX
As
android
.
graphics
.
Shader
.
TileMode
,
ModeY
As
android
.
graphics
.
Shader
.
TileMode
)
As
AS_Texture
Creates a texture with the given bitmap. This texture can be repeated or mirrored.
Image: a bitmap containing the texture image.
ModeX,ModeY: one of the TILEMODE constants for each axis.
IsInitialized
As
Boolean
[read
only]
Merge
(
Tex1
As
AS_Texture
,
Tex2
As
AS_Texture
,
MergeMode
As
android
.
graphics
.
PorterDuff
.
Mode
)
As
AS_Texture
Merges two textures of different types (a bitmap and a radial gradient for example).
The returned texture cannot be merged with another texture.
Tex1,Tex2: the textures to merge. They must be of different types.
MergeMode: one of the MERGEMODE constants.
MERGEMODE_DARKEN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_LIGHTEN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_MULTIPLY
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_SCREEN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX1_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_ATOP
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_IN
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_OUT
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_TEX2_OVER
As
android
.
graphics
.
PorterDuff
.
Mode
MERGEMODE_XOR
As
android
.
graphics
.
PorterDuff
.
Mode
TILEMODE_CLAMP
As
android
.
graphics
.
Shader
.
TileMode
TILEMODE_MIRROR
As
android
.
graphics
.
Shader
.
TileMode
TILEMODE_REPEAT
As
android
.
graphics
.
Shader
.
TileMode
Translate
(
OffsetX
As
Int
,
OffsetY
As
Int
)
Translates the origin point.
Top