Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

[SOLVED] Saving picture to PGM format doesn't work properly

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:
Code
PGM pgm = new PGM(filePath);
toolStripContainer1.ContentPanel.BackgroundImage = pgm.Image;
pgm.Save(filePath);


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by HardStoNJul 19, 2020 05:14 AM 7 287 Jul 19, 2020 05:14 AM
Last Post: DanketyDank
[C] by Sir BillyAug 26, 2019 06:33 PM 1 148 Aug 26, 2019 06:33 PM
Last Post: YouthInAsia
[Python] by kookurMar 4, 2019 04:18 PM 5 168 Mar 4, 2019 04:18 PM
Last Post: nicodxmus