How to quickly create some random image with the icon size?
I don't want to use neither Image.FromFile
, nor Image.FromStream
views:
63answers:
1
+3
A:
int width = 50;
int height = 50;
using (Bitmap bitmap = new Bitmap(width, height))
{
// do something to the bitmap
// perhaps use .SetPixel to maybe apply some color
bitmap.Save("C:\\Temp\\random.bmp");
}
Anthony Pegram
2010-04-02 06:55:49
+1 `Graphics.FromImage` will be helpful also.
Daniel Earwicker
2010-04-02 06:59:21
Its useful to declare Graphics object? which has more functions to edit picture. Graphics gr = Graphics.FromImage(bitmap);http://msdn.microsoft.com/en-us/library/system.drawing.graphics_members%28v=VS.71%29.aspx
Stremlenye
2010-04-02 08:44:10