Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9273693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:10:27+00:00 2026-06-18T16:10:27+00:00

i am trying to save an image from an image control named image1 in

  • 0

i am trying to save an image from an image control named image1 in my app mainpage to phone’s media library here is my code, but in WriteableBitmap wr = image1; it gives me an error.

public void SaveImageTo(string fileName = "Gage.jpg")
{
    fileName += ".jpg";
    var myStore = IsolatedStorageFile.GetUserStoreForApplication();
    if (myStore.FileExists(fileName))
    {
        myStore.DeleteFile(fileName);
    }

    IsolatedStorageFileStream myFileStream = myStore.CreateFile(fileName);
    WriteableBitmap wr = image1; // give the image source
    wr.SaveJpeg(myFileStream, wr.PixelWidth, wr.PixelHeight, 0, 85);
    myFileStream.Close();

    // Create a new stream from isolated storage, and save the JPEG file to the                               media library on Windows Phone.
    myFileStream = myStore.OpenFile(fileName, FileMode.Open, FileAccess.Read);
    MediaLibrary library = new MediaLibrary();
    //byte[] buffer = ToByteArray(qrImage);
    library.SavePicture(fileName, myFileStream); }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:10:29+00:00Added an answer on June 18, 2026 at 4:10 pm

    You are trying to assign the Control “image1” to a WriteableBitmap object, that’s why you have an error (they are 2 different types).

    You should initialize the WriteableBitmap differently, depending on how the source of “image1” was set.

    If “image1” references a local image, you can initialize the corresponding WriteableBitmap that way:

    BitmapImage img = new BitmapImage(new Uri(@"images/yourimage.jpg", UriKind.Relative));
    img.CreateOptions = BitmapCreateOptions.None;
    img.ImageOpened += (s, e) =>
    {
        WriteableBitmap wr = new WriteableBitmap((BitmapImage)s);
    };
    

    If you want to render your Image control into a WriteableBitmap, you can do that:

    WriteableBitmap wr = new WriteableBitmap(image1, null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to save multiple image using this code. But instead its saving
I am trying to download image from internet using open-uri. Here is code: require
Here's what I'm trying to accomplish: Load an image from a remote server Save
I am trying to save image from fileupload control into the database public Byte[]
I'm trying to save a copied image from the clipboard but it's losing its
I'm trying to get an image from URL and save it to the isolated
I am trying to save image captured from web cam with current time.Like 06.06.2010
I am trying to save out a large image from flash using bitmapdata and
In my app, I am trying to save and retrieval of an image in
I'm trying to download and save an image from the web using python's requests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.