This is a migrated thread and some comments may be shown as answers.

Saved image is empty

1 Answer 49 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
StepTNT
Top achievements
Rank 1
StepTNT asked on 25 Dec 2013, 05:50 PM
I'm using the ImageEditor in my page and everything works because I can actually edit and work with the image.
But once I save it, the saved image is just empty.
I gave a look to the bytes that it was saving and the whole Pixels array of the Bitmap contains the same value (-75xxx, i don't remember the missing digits).

Here's my C# code to handle the save

private const string BaseName = "/backgrounds/{0}.jpg";
private string _filename;
 
private void RadImageEditor_OnImageSaving(object sender, ImageSavingEventArgs e)
{
    e.FileName = _filename = string.Format(BaseName, Path.GetRandomFileName());
    e.JpgQuality = 100;
}
 
private void RadImageEditor_OnImageSaved(object sender, ImageSavedEventArgs e)
{           
    PreviewImage.Source = new BitmapImage(new Uri(e.FileName, UriKind.RelativeOrAbsolute));    
}

I'm sure that the image is saved because I can open the editor again with the same image and, after saving it, it shows empty even in the editor.

What am I doing wrong?

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 30 Dec 2013, 02:52 PM
Hi Stefano,

Thank you for your question.

When you specify the filename of the image, it is the name that is used to save the image inside the phone's Media Library. When you pass that name in the ImageSaved event, you actually search for that image inside the projects folder and not inside the phone's gallery. You have two options here: either open the image from the MediaLibrary, or use RadImageEditor's ModifiedImage property to access the image that you have saved.

Let us know if you need further assistance.

Regards,
Todor
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
ImageEditor
Asked by
StepTNT
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or