modifique la primera linea de codigo,,sera logico asi ¿?
Public Sub New(ByRef target As Windows.Forms.Control, ByVal width As Integer, ByVal height As Integer, ByVal pixelformat As Drawing.Imaging.PixelFormat,ByVal Buffer as intPtr)
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