About image display in Xamarin forms

TS44 81 Reputation points
2020-11-25T07:48:57.337+00:00

Does the processing time of the application change depending on whether the build action of the image file is used as an embedded resource or content?

https://dotnetco.de/tips-on-performance-for-xamarin-forms-android-and-ios/
https://stackoverflow.com/questions/37025546/what-does-load-resources-from-content-instead-of-resource-mean/37025626#37025626

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 71,926 Reputation points Microsoft Vendor
    2020-11-25T11:07:58.883+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    Does the processing time of the application change depending on whether the build action of the image file is used as an embedded resource or content?

    Based on my research, the answer is Yes, If you set the build action as an embedded resource, when you need to load it in your application, this read operation is the same as load the image from external storage. not load the image from Resouces/drawable folder in android. And If you need to adapt screen for different devices, normally, Android will load the image from (mipmap-hdpi, mipmap-mdpi, mipmap-xhdpi, mipmap-xxhdpi and mipmap-xxxhdpi) depend on your screen resolution directly, mipmap-hdpi, mipmap-mdpi, mipmap-xhdpi, mipmap-xxhdpi and mipmap-xxxhdpi folder is app's internal resource, If you set Images' build action as an embedded resource, it is external resources, you need to load it from external file storeage.

    Best Regards,

    Leon Lu


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our [documentation][1] to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments