I confess I do not know how to look for posts related to this issue, which is:
First time I get image height/width equal 0, subsequents are Ok.
Any advice?
Thanks in advance.
Yes, it takes a little bit of time until you can get that information
Use a clock component, timer interval 250 and enable the clock in the AfterActivity event.Then in the Clock Timer event get width and height and disable the clock again
Taifun
why you need to get the width/height of the image?
Since it's not the real size of the photo, just the size of the image component (like a container for the photo.)
Thank you for your interest.
This is part of a much bigger application. I need to know the proportion of the image. I got a division by 0 error, this is just a test case to show the root of this error.
Regards.
Thank you for your interest.
Yes, I suspected that and tried with a clock, just as you suggest, set to 400. I still got the error, so I simplified the test case again. I also tried waiting, doing nothing, while image1.height = 0, and it never ended. Perhaps I did something wrong.
I trust you and will try again more thoughtfully and come back.
Do you know why the second time it gives me the dimensions right, even with a different image?
Thanks again & regards
Try this
imgSize.aia (324.1 KB)
(on my computer the actual image dimensions are 298x413)
If you can use extensions, you might consider using this:
Works the same when using ActivityStarter - PICK
The second time it gave you the dimensions of the first image
Taifun
Thank you.
I managed to get through the image load issue. I had a problem with Android 13. It worked as expected after asking for ReadMediaImages permission.
I do not own an Android 13 device, nor I know how to get an Android 13 emulator. Samsung web site has some emulator skins but apparently those are only layout emulators. I need to ask a friend to act as alpha tester
Now I get another problem with canvas touched not detected, but I will ask for help in a different post if I cannot solve or isolate it.
Thank you for your help.
Regards.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.