Sub Button1_Click
Dim url As String
Dim LongVal As Long
Dim dialog As InputDialog
dialog.InputType = dialog.INPUT_TYPE_NUMBERS
dialog.Show("ImageMeter Image ID","Eingabe","OK","","",Null)
If dialog.Response = DialogResponse.POSITIVE Then
LongVal = dialog.Input
If LongVal <> -1 Then
url = "content://de.dirkfarin.imagemeterpro/image/anno/" & LongVal
File.Delete(File.DirDefaultExternal, "test_"& LongVal &".jpg")
Dim jo As JavaObject
jo.InitializeStatic("anywheresoftware.b4a.objects.streams.File")
Dim In As InputStream = File.OpenInput(jo.GetField("ContentDir"), url)
Dim bmp As Bitmap
bmp.Initialize2(In)
In.Close
Dim out As OutputStream
out = File.OpenOutput(File.DirDefaultExternal, "test_"& LongVal &".jpg",False)
bmp.WriteToStream(out,80,"JPEG")
out.Close
ImageView1.Bitmap = LoadBitmap(File.DirDefaultExternal,"test_"& LongVal &".jpg")
End If
End If
End Sub