Dim imgData As Map = Images.Get(url)
img = imgData.Get("image")
I want to load a BMP into my B4XImage object in B4A with the following code, but an image that should be vertical is displayed horizontally. This only happens with some images. In B4i, the same code works perfectly; it's as if iOS always handles it correctly, but B4A does not. I tried getting the image orientation from the data and then rotating it, but it sometimes fails. What could be the best solution?
- Should I keep trying the option of rotating it? Or maybe B4XImage already solves it in a way I haven't found? This only happens with some images.
But if I do it directly with SMM from the URLs, I should be able to download it directly, right? Without saving them to the device, that's what it's for, isn't it?
'Similar to SetMediaWithExtra. Loads a local file. The Mime type must be set.
'This is different than AddLocalMedia where the media is directly added to the cache.
'Use this method to display local resources. Use AddLocalMedia to add error / loading resources.
Public Sub SetMediaFromFile(Target As B4XView, Dir As String, FileName As String, Mime As String, Extra As Map)
According to the first post, there is a problem with the orientation of the .BMP images. You can check the orientation of the image before uploading it by checking its header.
Why don't you upload a project to see what you want to do?