Convert graphics object to bitmap object

后端 未结 3 1350
温柔的废话
温柔的废话 2020-12-31 03:53

How can I convert graphics object to bitmap object using C#?

3条回答
  •  情书的邮戳
    2020-12-31 04:03

    Bitmap myBitmap = new Bitmap(width, height, myGraphics);
    

    Alternatively:

    Graphics myGraphics = Graphics.FromImage(myBitmap);
    // some code with draw on myGraphics
    myGraphics.Dispose();
    

提交回复
热议问题