iOS Question xResizeAndCrop - Does anyone have a working demo for iPhone

tsteward

Well-Known Member
Licensed User
Longtime User
I just downloaded the demo project from HERE, and it works.
So, where or what is the problem ?
Sorry I just assumed the sample didn't work when it appeared b4i code was missing

B4X:
Private Sub btnLoadImage_Click
    Private n As Int

#If B4A
    Chooser.Initialize("Chooser")
    Chooser.Show("image/*", "Select an image")
#Else If B4i
#Else If B4J
    Private lstExtensions As List
    lstExtensions.Initialize2(Array As String("*.bmp", "*.jpg", "*.png"))
    Chooser.SetExtensionFilter("Image files", lstExtensions)
    Chooser.Title = "Select an image file"
    ImageFileName = Chooser.ShowOpen(Main.MainForm)
    If ImageFileName <> "" Then
        Log(ImageFileName)
        n = ImageFileName.LastIndexOf("\")
        ImageDir = ImageFileName.SubString2(0, n)
        ImageFileName = ImageFileName.SubString(n + 1)
        xResizeAndCrop1.LoadImage(ImageDir, ImageFileName)
    End If
#End If
End Sub
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
hoping someone has a working example
what is wrong with the example project in the main thread?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
There are two threads about the subject, but it seems not beeing that easy in B4i.
It's easy:
iMedia lib. is needed
B4X:
    Dim cam As Camera
    cam.Initialize("cam", B4XPages.GetNativeParent(Me))
    cam.SelectFromSavedPhotos(Sender, cam.TYPE_IMAGE)
    Wait For (cam) Cam_Complete(Success As Boolean, Image As B4XBitmap, VideoPath As String)
    If Success Then
        If Image.IsInitialized Then
            xResizeAndCrop1.Image = Image
        End If
    End If
 

Attachments

  • xResizeAndCropDemo.zip
    382.7 KB · Views: 7
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…