Sub Camera1_PictureTaken (Data() As Byte)
Dim out As OutputStream
Dim In As InputStream
Dim filename As String = "Test.JPG"
Dim dir As String = File.DirRootExternal
In.InitializeFromBytesArray(Data, 0, Data.Length)
bmp.Initialize2(In)
Panel2.SetBackgroundImage(bmp)
canv1.Initialize(Panel2)
rect1.Initialize(0,710dip,1050dip,760dip)
canv1.DrawRect(rect1,Colors.Black,True,5dip)
canv1.DrawText("Some kind of information 15/05/2013 16:32",100dip,750dip,Typeface.DEFAULT_BOLD,50,Colors.White,"LEFT")
Panel2.Invalidate
out = File.OpenOutput(dir,filename , False)
canv1.Bitmap.WriteToStream(out,100,"JPEG")
out.Close
IO.recycle(bmp)
camEx.StartPreview 'restart preview
'send a broadcast intent to the media scanner to force it to scan the saved file.
Dim Phone As Phone
Dim i As Intent
i.Initialize("android.intent.action.MEDIA_SCANNER_SCAN_FILE", "file://" & File.Combine(dir, filename))
Phone.SendBroadcastIntent(i)
ToastMessageShow("Picture saved." & CRLF & "File size: " & File.Size(dir, filename), True)
End Sub