Sub Globals
Dim Bot7200 As Button
Dim Bot14400 As Button
Dim Bot28800 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Bot7200.Initialize ("Bot7200")
Activity.AddView (Bot7200,10dip,10dip,150dip,35dip)
Bot7200.Text ="7200x600 pixel"
Bot14400.Initialize ("Bot14400")
Activity.AddView (Bot14400,10dip,50dip,150dip,35dip)
Bot14400.Text ="14400x600 pixel"
Bot28800.Initialize ("Bot28800")
Activity.AddView (Bot28800,10dip,90dip,150dip,35dip)
Bot28800.Text ="28800x600 pixel"
End Sub
Sub Bot7200_click
CreaBMP (7200)
End Sub
Sub Bot14400_click
CreaBMP (14400)
End Sub
Sub Bot28800_click
CreaBMP (28800)
End Sub
Sub CreaBMP (larg As Int)
Dim bmp As Bitmap
Dim C As Canvas
Dim brect As Rect
Dim Orizzonte As Float = 0.5
Dim out As OutputStream
bmp.InitializeMutable (larg,600)
C.Initialize2 (bmp)
brect.Initialize (0,0,DipToCurrent(larg), DipToCurrent(600))
C.DrawRect (brect, Colors.white, True, DipToCurrent(600))
'--- draw
For px = 0 To larg Step 200
C.DrawLine (px,600*Orizzonte-10,px,600*Orizzonte+10,Colors.LightGray,1dip)
Next
'--- orizzonte
C.DrawLine (0,600*Orizzonte,larg,600*Orizzonte,Colors.Black,1dip)
C.DrawText ("Test " & larg,0,580,Typeface.default,16,Colors.Blue,"LEFT")
'--- write
out = File.OpenOutput(File.DirRootExternal, "test.jpg", False)
bmp.WriteToStream (out,80,"JPEG")
out.Close
Msgbox ("Test","OK")
End Sub