Sub Globals
Dim Canvas1 As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim Path1 As Path
Dim bmpTest As Bitmap
Dim DestRect As Rect
bmpTest.Initialize(File.DirAssets, "Rose1.jpg")
Canvas1.Initialize(Activity)
DestRect.Initialize(0, 0, 100%x, 100%y)
Path1.Initialize(50%x, 100%y)
Path1.LineTo(100%x, 50%y)
Path1.LineTo(50%x, 0%y)
Path1.LineTo(0%x, 50%y)
Path1.LineTo(50%x, 100%y)
Canvas1.ClipPath(Path1) 'clip the drawing area to the path.
Canvas1.DrawBitmap(bmpTest, Null, DestRect) 'fill the drawing area with the gradient.
Activity.Invalidate
End Sub