Convert graphics object to bitmap object

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

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

3条回答
  •  一个人的身影
    2020-12-31 04:05

    Do you mean System.Drawing.Graphics ? The Graphics class is a surface to an image and is already a bitmap.

    What are you trying to do with it ?

    using(Graphics g = Graphics.FromImage(bitmap))
    {
      //draw here
    }
    

    or

    Bitmap bmp = new Bitmap(100,100,graphics);
    

提交回复
热议问题