Hello,
Welcome to our Microsoft Q&A platform!
What is the most efficient way to display an image?
Put the image to the PCL and set the build action is Embedded Resource
, it is not efficient way, this way like put your image to the local storage, you have to do the file I/O to read it. You can see offical article:https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/images?tabs=windows#embedded-images
The efficient way: This method of distributing images is recommended when identical images are used on each platform, and is particularly suited to creating components, as the image is bundled with the code. For example:
IOS => You need put the images on "Resources" (note: no more routes) , for ANDROID => you need put the images on "Resources/drawable" .for UWP => put the images on root project UWP.
On Diferents platforms the images have diferents routes.
Then on the xaml files you can put <Image Source="imageName.jpg" />
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.