Answer the question
In order to leave comments, you need to log in
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);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question