T
T
tex6202018-01-22 15:28:28
Images
tex620, 2018-01-22 15:28:28

How to save image without compression C#?

There is a two-dimensional maze array of 0 and 1, there is a function that creates a picture and paints 1 black and 0 white

public void Save(string name) {

            Bitmap bmp = new Bitmap(height, width);
            bmp.SetResolution(height, width);
            for (int H = 0; H < height; H++)
            {
                for (int W = 0; W < width; W++)
                {
                    if (maze[H, W] == 0) {
                        bmp.SetPixel(H,W,Color.White);  //пусто
                            } else if (maze[H, W] ==1)
                    {
                        bmp.SetPixel(H,W,Color.Black); //стена
                    }
                }


            }
            bmp.Save(name, ImageFormat.Wmf);

however, after saving, the blur in the picture is clearly visible.
I suspect that this is due to compression, tell me how to COMPLETELY turn off compression, I need it.
Thanks in advance)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2018-01-22
@GavriKos

Supply ImageFormat.Bmp, for example. Or PNG.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question