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 6046839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:17:08+00:00 2026-05-23T07:17:08+00:00

I am saving image into isolated storage each image have a different imageFileName. But

  • 0

I am saving image into isolated storage each image have a different imageFileName. But i am having problem to retrieve all the saved image in a listbox.
Only managed to retrieve the latest image saved.
When i hard code the filepath then can retrieve it.
I hope anyoen can help me with the code.. Hopefully anyone can try editing my code. Thanks.

Save code:

private void SaveToLocalStorage(string imageFolder, string imageFileName)
        {
            imageFileName = App.imagePath;

            var isf = IsolatedStorageFile.GetUserStoreForApplication();
            if (!isf.DirectoryExists(imageFolder))
            {
                isf.CreateDirectory(imageFolder);
            }

            string filePath = Path.Combine(imageFolder, imageFileName);
            using (var stream = isf.CreateFile(filePath))
            {
                var bmp = new WriteableBitmap(inkCanvas, inkCanvas.RenderTransform);
                bmp.SaveJpeg(stream, bmp.PixelWidth, bmp.PixelHeight, 0, 100);
            }
            MessageBox.Show(filePath            }

Retrieve code:

private void LoadFromLocalStorage(string imageFolder, string imageFileName )
        {
            var isoFile = IsolatedStorageFile.GetUserStoreForApplication();
            if (!isoFile.DirectoryExists(imageFolder))
            {
                isoFile.CreateDirectory(imageFolder);
            }

            string filePath = Path.Combine(imageFolder, imageFileName);
            using (var imageStream = isoFile.OpenFile(filePath, FileMode.Open, FileAccess.Read))
            {
                var imageSource = PictureDecoder.DecodeJpeg(imageStream);

                BitmapImage bi = new BitmapImage();

                ListBoxItem item = new ListBoxItem();
                bi.SetSource(imageStream);
                item.Content = new Image() { Source = bi, MaxHeight = 100, MaxWidth = 100 };
                listBox1.Items.Add(item);
            }
}
  • 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-05-23T07:17:09+00:00Added an answer on May 23, 2026 at 7:17 am

    Try something like:

    private void LoadFromLocalStorage(string imageFolder)
    {
        var isoFile = IsolatedStorageFile.GetUserStoreForApplication();
    
        // Check if directory exists
        if(!isoFile.DirectoryExists(imageFolder))
        {
            throw new Exception("Image directory not found");
        }
    
        // Clear listbox
        listBox1.Items.Clear();
    
        // Get files
        foreach(string fileName in isoFile.GetFileNames())
        {
            string filePath = Path.Combine(imageFolder, fileName);
            using(var imageStream = isoFile.OpenFile(filePath, FileMode.Open, FileAccess.Read))
            {
                var imageSource = PictureDecoder.DecodeJpeg(imageStream);
    
                BitmapImage bi = new BitmapImage();
    
                ListBoxItem item = new ListBoxItem();
                bi.SetSource(imageStream);
                item.Content = new Image() { Source = bi, MaxHeight = 100, MaxWidth = 100 };
                listBox1.Items.Add(item);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble converting an image into bytes and saving it in database.
I wonder when saving plot into image file in matlab, what is the difference
I have a dynamically created image that I am saving to a stream so
I'm having trouble with displaying image from db. I think that method for saving
i need to get an image from client and displayed(preview) before saving it into
I have uploaded a text file to my database into a Image field. The
I've heard that most lisps support saving image of running program into file. Does
Ive i have two images from a URL into my gallery view. But when
I'm trying to save a Layout into an Image in the SDCard but I
While the following code is saving the image I took from my application into

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.