Load High-Resolution Image!

1 Answer 214 Views
ImageEditor Map
Shahram
Top achievements
Rank 1
Shahram asked on 29 Dec 2023, 05:53 AM
Hi
I'm new in .Net MAUI.
I want to add some high-resolution images in my app. The dimensions of the images are about 7000*4000 pixels, and they are layered on top of each other. (Layers will visible/invisible by buttons)
There is no problem on Windows platform, but when I run it on Android device or emulator, it runs very slow and laggy.
Considering that by double-clicking on the image, their scale will double or triple, if I reduce their dimensions, the final quality will decrease.
Is there a solution?

1 Answer, 1 is accepted

Sort by
1
Accepted
Lance | Senior Manager Technical Support
Telerik team
answered on 29 Dec 2023, 03:34 PM

Hello Shahram,

The rendering of the image is done by the .NET MAUI native graphics implementations (e.g. SkiaSharp, Maui Graphics, etc). This is something that is not in our control, but you can take steps to make things easier during development.

To improve performance on an Android emulator, I would recommend a couple things:

1. Improve the default RAM to 2048 and the heap to 800

2. Do not deploy with the debugger attached

3. Occasionally, deploy a Release build, instead of a Debug build, to have a more realistic end-user experience.

4. Consider decreasing the dimensions or density of the image

5. Use a different file format for the image, where the file size is smaller (makes loading it faster)

6. Try loading the bitmap into memory and use the memory reference (instead of file reference)

 

At the end of the day, a 7000*4000 image is not huge, especially considering today's display resolutions and your device should be able to handle it. Some small considerations now can have a larger impact on the end experience (e.g., using a lightweight png instead of a very dense jpg).

Regards,
Lance | Manager Technical Support
Progress Telerik

A brand new .NET MAUI course was just added to the Virtual Classroom. The training course is developed to help you get started with the Telerik UI for .NET MAUI components and features. It aims to put you in the shoes of an engineer who adds new features to an existing application. You can check it out at https://learn.telerik.com
Tags
ImageEditor Map
Asked by
Shahram
Top achievements
Rank 1
Answers by
Lance | Senior Manager Technical Support
Telerik team
Share this question
or