开发者

how to quickly create dummy image directly in .NET code

开发者 https://www.devze.com 2022-12-25 04:48 出处:网络
How to quickly create some random image with the icon size? I don\'t want to use neither Image.开发者_C百科FromFile, nor Image.FromStreamint width = 50;

How to quickly create some random image with the icon size? I don't want to use neither Image.开发者_C百科FromFile, nor Image.FromStream


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");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消