Yep, but is this possible without API's?
Code:
Public Shared Sub TransferGraphics(ByVal source As Graphics, ByVal dest As Graphics, ByVal destrect As Rectangle)
Dim shdc As IntPtr = source.GetHdc
Dim dhdc As IntPtr = dest.GetHdc
BitBlt(dhdc, destrect.X, destrect.Y, destrect.Width, destrect.Height, shdc, 0, 0, SRCCOPY Or CAPTUREBLT)
source.ReleaseHdc(shdc)
dest.ReleaseHdc(dhdc)
End Sub
Private Const SRCCOPY = &HCC0020
Private Const CAPTUREBLT = &H40000000
Private Declare Function BitBlt Lib "gdi32" (ByVal hdc As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As UInteger) As Boolean
I failed to find these types of operations in the Graphics class. How come I can't make my Graphics object write to another source, or, obtain data from another source.
E.g. DrawGraphics(g)
Ow and thanks for pointing me on the "CopyFromScreen", it seems to contain some sort of BitBlt but it does not allow you to specify a source.
CopyFromScreen is nice, but if it is the only function for "BitBlt" the Graphics object is a pretty lousy wrapper.
BTW: it did help me so far, I now understand it is useless to make a DC class since the Graphics class has this mostly implemented.
I will just make some functions to extend the Graphics class, as long it is required. But still...why aren't these logical functions added?!