简体   繁体   中英

how to create 1px X 1px on .Net

我需要一个图像1px X 1px或使用c#清空Jpeg图像

我现在无法测试,但不应该这样做吗?

(new Bitmap(1,1)).Save(name,ImageFormat.Jpeg);

You can do something like this ..

            var image = new Bitmap(1, 1);
            MemoryStream stream = new MemoryStream();
            image.Save(stream, ImageFormat.Jpeg);
            stream.Position = 0;

And then save the stream to a file.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM