Jan 14, 2018 04:02 PM
(This post was last modified: Jan 15, 2018 05:04 AM by Electron.)
Edit: Problem solved!
Anyone who might use this, here is a working link: https://pastebin.com/dHkcwbDH
Hello,
I have a problem with saving an image to .PGM P2 format. Opening a picture works fine but saving it doesn't work. It makes the picture somehow messy. I'm trying to convert the Bitmap to byte[] and then save the byte[] to .PGM file. Note that there will be some processing with the image after opening it, so it should be saved as Bitmap to .PGM in the end.
Code:
https://pastebin.com/1Yt8H072
Usage:
Anyone who might use this, here is a working link: https://pastebin.com/dHkcwbDH
Hello,
I have a problem with saving an image to .PGM P2 format. Opening a picture works fine but saving it doesn't work. It makes the picture somehow messy. I'm trying to convert the Bitmap to byte[] and then save the byte[] to .PGM file. Note that there will be some processing with the image after opening it, so it should be saved as Bitmap to .PGM in the end.
Code:
https://pastebin.com/1Yt8H072
Usage:
Code
PGM pgm = new PGM(filePath);
toolStripContainer1.ContentPanel.BackgroundImage = pgm.Image;
pgm.Save(filePath);
