How to delete images (null). (SfImageEditor)

Hello friends.

After I take a picture and save it. I want the image to be empty.

I tried

SfImageEditor.Source = null;

But no success (it still shows) ==> I want it to be null

Thank you guys.


3 Replies

ET Eswaran Thirugnanasambandam Syncfusion Team August 23, 2021 12:46 PM UTC

Hi Huy Nguyen Xuan, 
 
Thanks for contacting Syncfusion support. 
 
Your requirement can be achieved by dynamically setting the image source as null. When dynamically setting the image source as null the image in the image editor will be removed and it will not display any image. 
 
Based on your requirement we have prepared a sample to remove the image. In the sample, we will remove the image by setting the image source as null in a button click. Please get the sample from the below link. 
 
 
Please check the sample and let us know if you have any concerns. If you still face any problem, can you revert us by modifying the attached sample based on your scenario, this will help us to provide you a better solution at the earliest. 
 
Regards,  
Eswaran 



HN Huy Nguyen Xuan August 24, 2021 07:56 AM UTC

Thanks for your support.

I apologize for not making my question clear.

My approaches are different from yours so I applied "editor.Source = null;" with no success.

My XAML Code

<syncfusion:SfImageEditor x:Name=" editor " Grid.Row="3"  HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" ImageSaving=" editor_ImageSaving"/>

==> Do not use: Source="{Binding Image}"

My C# code to assign image to SfImageEditor

  editor .Source = new UriImageSource

 {

  Uri = new Uri("https://demoimage.blob.core.windows.net/luutru/001.jpg"),

CachingEnabled = false 

};

==> I use the code "editor.Source = null;" it doesn't change anything, doesn't make the image blank



ET Eswaran Thirugnanasambandam Syncfusion Team August 25, 2021 09:59 AM UTC

Hi Huy Nguyen Xuan,   
 
Thanks for your update.  
 
Using the provided snippet, we checked the reported issue by adding the image from URI and removing it by setting the image source as null. But we afraid that, we are not able to reproduce the reported problem in our side. Can you please check with the sample and tested video from the below location? 
 
 
 
If still you face the problem, please revert us by modifying the sample based on your application scenario along with replication procedure. This would be helpful for us to give better solution in this. 
 
Regards,    
Eswaran 


Loader.
Up arrow icon