Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

[WM20] - Fetching Image From Server to show in Image Control some times crashes (1 reply)

$
0
0
Hello,

I am using Image Control to show images.

These images are on a remote web server.

I have set the Image Control's (Details) Zoom and scroll with fingers to Automatic Scroll and Zoom. Because of this User can swipe on the Image Control to load another Image from server.

I am first fetching the image name from remote MySQL database and I have the following code in the Horizontal and vertical swipe event for loading Image:
IF InternetConnected() = False THEN
	Error("Internet not available")
	RETURN
END

HTTPRequest("[xxxxxxxxxxxxxxx.xxx]; + PhotoFileName)

IF ErrorOccurred = False THEN
	sResult is Buffer = HTTPGetResult(httpResult)
	IF Position(sResult,"404") THEN
		Info(HTMLToText(sResult)) 
	ELSE
		IF Length(sResult) > 0 THEN
			IMG_Photo = sResult
		END
	END
END

This is working perfectly as long as the user is patient and waits for the image to load. But if the user swipes multiple times in quick succession the app crashes.

How can I prevent this from happening?

TIA

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>