How to copy one Graphics Object into another

前端 未结 1 539
天命终不由人
天命终不由人 2020-12-18 10:45

I am trying to copy the contents of one graphics object to another, but the only was I have been able to find is based on using GDI32.DLL, which i would rather

相关标签:
1条回答
  • 2020-12-18 10:59

    Strictly speaking, it's not possible to copy the contents of a Graphics object anywhere using any method, because a Graphics object doesn't contain anything.

    Why don't use the DrawToBitmap method to draw the control on the bitmap?

    Dim srcBmp As New Bitmap(pnl.Width, pnl.Height)
    Dim clip As New Rectangle(New Point(0, 0), pnl.Size)
    pnl.DrawToBitmap(srcBmp, clip)
    
    0 讨论(0)
提交回复
热议问题