Reputation: 718
I need an image 1px X 1px or empty Jpeg image using c#
Upvotes: 2
Views: 2206
Reputation: 4108
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.
Upvotes: 4
Reputation: 2667
I can't test this right now, but shouldn't this work?
(new Bitmap(1,1)).Save(name,ImageFormat.Jpeg);
Upvotes: 8