Hi Reihaneh,
Greetings from Syncfusion.
Query: Is there a way to be able to load the images to SfImageEditor that their build action has been set to AndroidResource.
We have validated your query and we found that image is not loaded from drawable resource in image editor android. But when we give absolute path of file then its working correctly as like below code snippet.
|
editor.Source = ImageSource.FromFile("image.png"); // Not working editor.Source = ImageSource.FromFile("/storage/0/emulated/Pictures/image.png"); // Working |
So, we have created workaround sample to copy the drawable image file to gallery and then loading image from file path. Please find the sample from below link
In this sample, we have done following things
1. Created Dependency service method GetPath() to copy image from drawable resource to gallery.
|
// pass image name as argument to GetPath method. var path = DependencyService.Get < IFileHelperInterface().GetPath("image.png"); editor.Source = ImageSource.FromFile(path); |
We request you to try the above sample and let us know if you have any concern.
Also, we have logged bug report to read the image from drawable folder and this will be included in 2018 Volume 3 SP1 release which is expected to be released on end of October 2018.
Thanks,
Michael