WriteableBitmap problem

mastiSoft
mastiSoft used Ask the Experts™
on
HI.
I need to get save a writable bitmap as jpg for example . In my application I create a few writable bitmaps, but I show only one and user can choose if he will load another writable bitmap. To do that I think I need to create an list with path to all writable bitmaps ( or created jpg files, I don't know) and for that I have to save them somewhere.
Do you have any idea how to do that?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
Post some code please

Author

Commented:
for (int j=0; j<AmountFiles; j++) // it can be upp to 16 files
{
// get data from the data file with path
       using (FileStream fs = File.OpenRead(t_path))
            {
                using (BinaryReader binaryReader = new BinaryReader(fs))
                {

                    Data16 = binaryReader.ReadBytes(size);
                         }
                fs.Close();
                fs.Dispose();
            }
              var bitmap = new WriteableBitmap(width, height, 96, 96, PixelFormats.Indexed8, myPalette);
             stride = ((width * bitmap.Format.BitsPerPixel) + (width % 4));                      
             image_data = new byte[(int)(height * stride)]; // Set the dimensions of the IMAGE ARRAY declared above

            // some function here that setpixel to image_data
           
                   bitmap.WritePixels(new Int32Rect(0, 0, width, height), image_data, (int)stride, 0); //pay attantion when we use Palette then color have to be send as "0"
                        var rotatedImage = new TransformedBitmap(bitmap, new RotateTransform(90));
                     MyImage.Source = rotatedImage; //redraws every time new trace loads // this is works but all images overwrite each others and shows one after another in MyImage (


//somewhere here I have to do something to save path to the created files in List . This is needs to load all images in the list box
// for user select one of them
}
I found the solution.
Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
Hi mastiSoft

Sorry I missed your comment. I was oversees when you replied

Author

Commented:
I put the question on April and now in June I found the solution. No one of the expert gives any answer to my request.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial