Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("Page1")
pnl = xui.CreatePanel("")
Page1.RootPanel.AddView(pnl, 0, 0, 200dip, 200dip)
imageview.Initialize("img")
pnl.AddView(imageview, 0, 0, pnl.Width, pnl.Height)
NavControl.ShowPage(Page1)
If Not(File.Exists(File.DirLibrary, "TestBitmap")) Then
File.MakeDir(File.DirLibrary, "TestBitmap")
End If
End Sub
Sub Cam_Complete (Success As Boolean, image As Bitmap, VideoPath As String)
If Success Then
If image.IsInitialized Then
imageview.ContentMode = imageview.MODE_FIT
imageview.Bitmap = image
Dim out As OutputStream = File.OpenOutput(File.DirLibrary & "/" & "TestBitmap", "bitmap.jpeg", False)
If Switch1.Value Then
pnl.Rotation = 90
Dim im As Bitmap = pnl.Snapshot
im.WriteToStream(out, 50, "JPEG")
Else
image.WriteToStream(out, 50, "JPEG")
End If
out.Close
Dim p As Phone
p.AddImageToAlbum(LoadBitmap(File.DirLibrary & "/" & "TestBitmap", "bitmap.jpeg"))
End If
End If
End Sub