@codeblue said in The image is not displayed:
Hi Team,
I was trying to display image with
Widgets.Image('res/img/demo.jpg', 0, 0)
demo.jpg is a 240x240 jpg file.
the code runs without error, but no image is displayed as expected.
But with Widgets.Image('res/img/uiflow.jpg', 100, 100), I can see the built-in image.
Any advice ?
Thanks,
Joey
Hey Joey,
It seems like you're trying to display an image using the Widgets.Image() function in your code. The fact that you can see the built-in image with 'res/img/uiflow.jpg' suggests that the function itself is working correctly.
Make sure to check the following:
File Path: Double-check the file path for 'demo.jpg' to ensure it's correct. It should point to the location of the 'demo.jpg' file on your device.
File Existence: Ensure that 'demo.jpg' exists in the specified path and that it's a valid image file.
File Format: Confirm that 'demo.jpg' is indeed a JPEG image and not another format like PNG or GIF.
If all these checks are in order and you're still not seeing the image, there may be an issue with the image itself. Try opening 'demo.jpg' in an image viewer to make sure it's not corrupted or unreadable.
Hope this helps you troubleshoot the issue!