Gracias lo que tu me has respondido era lo mismo en lo que estaba trabajando.
Sin embargo ahora me hallo ante un nuevo error.
Primero asi ha quedado el metodo
GCHandle handle = GCHandle.Alloc(arrayRegistro, GCHandleType.Pinned);
int scan0 = (int)handle.AddrOfPinnedObject();
scan0 += (altoVideo - 1) * stride;
int bitmapPaddedDataSize=( stride * altoVideo * 3);
byte[] bmpBytes = new byte[bitmapPaddedDataSize];
//Copiar el puntero a un array de bytes
Marshal.Copy((IntPtr)scan0, bmpBytes, 0, bmpBytes.Length);
//Obtener memoria para los nuevos datos de bitmap,
IntPtr punteroDatos = Marshal.AllocHGlobal(bitmapPaddedDataSize);
//Copiar el array de bytes creado al puntero
Marshal.Copy(bmpBytes, 0, punteroDatos, bmpBytes.Length);
//Crear bmp
captura = new Bitmap(anchoVideo, altoVideo, -stride,
PixelFormat.Format24bppRgb, punteroDatos);
handle.Free();
Lo llamo para asignarlo al atributo imagen de un objeto secuencia
Bitmap imgGol = video.Captura();
Y al tratar de mostrarlo
e.Graphics.DrawImage(secuencia.Imagen, posImagen);
En la siguiente sentencia me da el error
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Con esta stackTrace
at System.Drawing.SafeNativeMethods.Gdip.GdipDrawImageRectI(HandleRef graphics, HandleRef image, Int32 x, Int32 y, Int32 width, Int32 height)
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect)
at OrganizerINEF.componentes.SecuenciasEventosC.listBox1_DrawItem(Object sender, DrawItemEventArgs e) in C:\Documents and Settings\lfcia\Mis documentos\Visual Studio 2005\Projects\OrganizerINEF\OrganizerINEF\es\aitdx\vista\componentes\segundoNivel\SecuenciasEventosC.cs:line 87
at System.Windows.Forms.ListBox.OnDrawItem(DrawItemEventArgs e)
at System.Windows.Forms.ListBox.WmReflectDrawItem(Message& m)
at System.Windows.Forms.ListBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WmOwnerDraw(Message& m)
at System.Windows.Forms.Control.WmDrawItem(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ListBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at OrganizerINEF.Program.Main() in C:\Documents and Settings\lfcia\Mis documentos\Visual Studio 2005\Projects\OrganizerINEF\OrganizerINEF\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Gracias por todo