Sub CameraImageSelectButton_Click
cam.Initialize("cam", Page1)
cam.SelectFromPhotoLibrary(Sender, cam.TYPE_ALL)
End Sub
Sub Cam_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
If Success Then
If Image.IsInitialized Then
ImageView1.Bitmap = Image
ScrollView1.Panel.AddView(ImageView1,0,0,(ImageView1.Bitmap.Width * .3),(ImageView1.Bitmap.Height * .3)) 'im reducing the image size by 1/3 because it is huge
ScrollView1.ContentHeight = ImageView1.Height
ScrollView1.ContentWidth = ImageView1.Width
Else
Msgbox("Error retrieving image","Error")
End If
End If
End Sub
Sub BtnSave_Click
Dim cnv As Canvas
cnv.Initialize(ScrollView1)
cnv.Refresh
Dim rectDest As Rect
rectDest.Initialize(0, 0, ImageView2.Width, ImageView2.Height)
cnv.DrawView(ScrollView1,rectDest)
Dim bmp As Bitmap
bmp = cnv.CreateBitmap
cnv.Refresh
Dim out As OutputStream = File.OpenOutput(File.DirDocuments, "ProfPic.jpg", False)
bmp.WriteToStream(out, 100, "JPEG")
out.Close
ImageView2.Bitmap = LoadBitmap(File.DirDocuments, "ProfPic.jpg")
End Sub
Sub BtnEnlarge_Click
ImageView1Test.Width = (ImageView1Test.Width * 1.5)
ImageView1Test.Height = (ImageView1Test.Height * 1.5)
ImgScroll.ContentHeight = ImageView1Test.Height
ImgScroll.ContentWidth = ImageView1Test.Width
End Sub
Sub BtnSmaller_Click
ImageView1Test.Width = (ImageView1Test.Width / 1.5)
ImageView1Test.Height = (ImageView1Test.Height / 1.5)
ImgScroll.ContentHeight = ImageView1Test.Height
ImgScroll.ContentWidth = ImageView1Test.Width
End Sub