tengo el fragmento de este code el cual toma una captura de la pantalla y todo bien lo toma sin problemas, el problema es el siguiente
Public Sub New()
'escritorio = rectangle
B_rectangle = Windows.Forms.Screen.PrimaryScreen.Bounds
'encapsulamos mapas de bits a partir del B_rectangle.
B_image = New Drawing.Bitmap(B_rectangle.Width, B_rectangle.Height, Drawing.Imaging.PixelFormat.Format32bppArgb)
'crea la imagen a partir de b_image
B_graphics = Drawing.Graphics.FromImage(B_image)
End Sub
Public Function GetSnapshot() As IntPtr Implements Icaptura.GetSnapshot
If B_bitmapData IsNot Nothing Then
Throw New InvalidOperationException("Hay que liberar la instantánea actual antes de obtener una nueva.")
End If
B_graphics.CopyFromScreen(0, 0, 0, 0, B_rectangle.Size)
B_bitmapData = B_image.LockBits(B_rectangle, Drawing.Imaging.ImageLockMode.ReadOnly, Drawing.Imaging.PixelFormat.Format32bppArgb)
Return B_bitmapData.Scan0
End Function
Public Sub New(ByRef target As Windows.Forms.Control, ByVal width As Integer, ByVal height As Integer, ByVal pixelformat As Drawing.Imaging.PixelFormat)
o_target = target
o_graphics = o_target.CreateGraphics
b_rectangle = New Drawing.Rectangle(0, 0, width, height)
b_format = pixelformat
Dim stride As Integer
stride = 0
Select Case b_format
Case Drawing.Imaging.PixelFormat.Format16bppArgb1555, Drawing.Imaging.PixelFormat.Format16bppRgb555, Drawing.Imaging.PixelFormat.Format16bppRgb565
stride = (width * 2)
Case Drawing.Imaging.PixelFormat.Format24bppRgb
stride = (width * 3)
Case Drawing.Imaging.PixelFormat.Format32bppArgb, Drawing.Imaging.PixelFormat.Format32bppPArgb, Drawing.Imaging.PixelFormat.Format32bppRgb
stride = (width * 4)
End Select
b_length = height * stride
buffer = Runtime.InteropServices.Marshal.AllocHGlobal(b_length)
b_image = New Drawing.Bitmap(b_rectangle.Width, b_rectangle.Height, stride, b_format, buffer)
o_graphics.DrawImage(b_image, o_target.ClientRectangle)
End Sub
Public Sub DrawUpdate(ByVal intIndex As Integer, ByRef aryData() As Byte, ByVal intIndex_Data As Integer, ByVal intLength As Integer) Implements Idibujar.DrawUpdate
Runtime.InteropServices.Marshal.Copy(aryData, intIndex_Data, CInt(buffer) + intIndex, intLength)
End Sub
esta segunda part es fragmento de un code el cual no logro hacer que dibuje donde le designo....
o si hay alguna otra forma me seria de utilidad, y si desean las declaraciones de las variables las subo o algo mas.