ub SetUpBoard
DrawBackground3 '1 or 2 or
ShowMarbles
End Sub
' Draws background on panel
Sub DrawBackground1
Log("DrawBackground 1")
Dim bd As BitmapDrawable
bd.Initialize(LoadBitmap(File.DirAssets, "Board_British.bmp"))
bd.Gravity = Gravity.FILL
pnl1.Background = bd
End Sub
'Draws background bitmap on CVS1
Sub DrawBackground2
Log("DrawBackground 2")
Dim DestRect As Rect
DestRect.Initialize(0,0,pnl1.Width,pnl1.Height)
Dim bx As Bitmap
bx = LoadBitmap(File.DirAssets,"Board_British.bmp")
cvs1.DrawBitmap(bx, Null, DestRect)
pnl1.Invalidate
End Sub
'Draws background on CVS2, should be drawable with canvas
Sub DrawBackground3
Log("DrawBackground 3")
Dim bx As Bitmap
bx = LoadBitmap(File.DirAssets,"Board_British.bmp")
bx.InitializeMutable(700dip,700dip)
cvs2.Initialize2(bx)
pnl1.Invalidate
End Sub
'Shows marbles (Marble(x,y)=1) om CVS2
Sub ShowMarbles
Log("Show Marbles")
cvs2.DrawColor(Colors.Transparent)
Dim DestRect As Rect
For x=0 To 6
For y= 0 To 6
If Marbles(x,y) =1 Then
DestRect.Initialize(50+x*90, 50+y*90, 50+x*90+60, 50+y*90+60)
cvs2.DrawBitmap(MarbleBitmap, Null, DestRect)
End If
Next
Next
pnl1.Invalidate
End Sub