Saved image is empty

2 posts, 0 answers
  1. StepTNT
    StepTNT avatar
    18 posts
    Member since:
    Mar 2013

    Posted 25 Dec 2013 Link to this post

    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?
  2. Todor
    Todor avatar
    774 posts

    Posted 30 Dec 2013 Link to this post

    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.

    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top