sub button1_Click
Dim bmp,smaller As Bitmap
Dim fn As String
root=File.DirRootExternal
path1 = root & "/DCIM/Camera"
fn="TEST.JPG"
bmp.Initialize(path1, fn)
smaller.Initialize3(bmp)
smaller = ResizeRotateBitmap(bmp, 440,,440)
smaller=CreateScaledBitmap(smaller, 60, 440, True)
out = File.OpenOutput(path1 ,fn, False)
smaller.WriteToStream(out, 80, "JPEG")
out.Close
End Sub
Sub ResizeRotateBitmap(src_bmp As Bitmap, w As Int, h As Int) As Bitmap
Dim new As Bitmap
new.InitializeMutable(w, h)
Dim c As Canvas
c.Initialize2(new)
Dim dst_rect As Rect
dst_rect.Initialize(0,0, w, h)
c.DrawBitmapRotated (src_bmp,Null, dst_rect,90)
Return new
End Sub
Sub CreateScaledBitmap(Original As Bitmap, Width As Int, Height As Int, Filter As Boolean) As Bitmap
Dim r As Reflector
Dim b As Bitmap
b = r.RunStaticMethod("android.graphics.Bitmap", "createScaledBitmap", _
Array As Object(Original, Width, Height, Filter), _
Array As String("android.graphics.Bitmap", "java.lang.int", "java.lang.int", "java.lang.boolean"))
Return b
End Sub