Sub imgGallery3_Click
Dim q As Int
q= Msgbox2(mgsbox_uploadText,"Confirm","Upload","","Cancel",Null)
If q = DialogResponse.POSITIVE Then
RandFileName = Rnd(0001,9999) &"-"& Rnd(1450,6721) &"-"& Rnd(1223,3321) &".jpg"
clickedView = 4
GetFromGallery(File.DirRootExternal&"/app_temp/", RandFileName, 140)
Else If q = DialogResponse.NEGATIVE Then
ToastMessageShow("Operation cancelled", True)
End If
End Sub
Sub GetFromGallery(Directory As String, PictureName As String, size As Int)
Dim i As Intent
i.Initialize(i.ACTION_PICK, "")
i.SetType("image/*")
i.PutExtra("output", ParseUri("file://" & File.Combine(Directory, PictureName))) 'output folder you set OpenCam(File.DirRootExternal, "1.jpg")
i.PutExtra("crop", "true") 'crop ON
i.PutExtra("aspectX", 1) 'crop aspects
i.PutExtra("aspectY", 1) 'crop aspects
i.PutExtra("outputX", size) 'crop size //Set this to define the max size of the output bitmap
i.PutExtra("outputY", size) 'crop size //Set this to define the max size of the output bitmap
i.putExtra("scale", True)
i.putExtra("scaleUpIfNeeded", True)
StartActivity(i)
End Sub
Sub ParseUri(FileName As String) As Object
Dim r As Reflector
Return r.RunStaticMethod("android.net.Uri", "parse", Array As Object(FileName), Array As String("java.lang.String"))
End Sub