Ver Mensaje Individual
  #3  
Antiguo 11-03-2016
Ramsay Ramsay is offline
Miembro
NULL
 
Registrado: ene 2016
Posts: 104
Reputación: 9
Ramsay Va por buen camino
Ya encontre una forma que funciona , ahora estoy usando eventos en una unit :

Código Delphi [-]
    unit capture;
    
    interface
    
    uses SysUtils, Windows, Jpeg, Vcl.Graphics, VSample,
      VFrames, Classes;
    
    var
      m1: TMethod;
      video: TVideoImage;
    
    function capture_webcam(): boolean;
    
    implementation
    
    procedure OnNewVideoFrame(ASelf:Pointer; Width, Height: integer;
      DataPtr: Pointer);
    begin
      // start the code
    end;
    
    function capture_webcam(): boolean;
    var
      DeviceList: TStringList;
    begin
    
      DeviceList := TStringList.Create;
    
      video := TVideoImage.Create;
      video.GetListOfDevices(DeviceList);
      video.VideoStart(DeviceList[0]);
    
      m1.code := @OnNewVideoFrame;
      m1.Data := video;
    
      video.OnNewVideoFrame := TNewVideoFrameEvent(m1);
    
    end;
    
    //
    
    end.
Todo compila bien pero cuando ejecuto la funcion me devuelve este error : access violation at 0x0018fdee: write of address 0x00000000

Solo es ese detalle , ya funciona todo , ¿ alguien sabe cual es el problema al crear el evento ? porque funciona en otros eventos pero en este no.
Responder Con Cita