Thanks I have been able to capture picture in CSharp.
I was using video.ocx (free available on net) in Vbasic 6.0 to capture live
video. onFrame event used to give pointer to data and header of BMP file.
Following is part of code which used to give me access to data.
Declare Sub RtlMoveMemory Lib "kernel32" (ByVal hpvDest As Long, ByVal
hpvSource As Long, ByVal cbCopy As Long)
Private Sub VideoCapture1_OnFrame(ByVal bmph As Long, ByVal data As Long,
ByVal size As Long)
‘below line is copying data from pointer to data into array vd, 57001 are
bytes required to ‘be read
RtlMoveMemory VarPtr(vd(0, 0)), data, 57001
..
..
..
Data is a pointer to available data. I have used RltMoveMemory to move data
to array vd. It worked fine. Later I could use this data for image
processing.
Now I want to use same Ocx in C Sharp. I have been able to include the ocx
and capture the picture. I have problem in reading data from the ocx. Object
e has data, bmph and size available. I have tried to read data from variable
data (code is given below). It seems that in c Sharp it is simple int type
and not pointer to data.
private void axVideoCapture1_OnFrame(object sender,
AxVideoLib._DVideoCaptureEvents_OnFrameEvent e)
{
string output =" ";
unsafe
{
fixed(int *y = &e.data)
{
for(int i=0;i<20;i++)
label1.Text += i.ToString() + "=" +(*(y+i)).ToString()+ " " + '\n' ;
}
}
I need help in reading the frame data into user defined array. If
required I can email whole of VB and CSharp code.
Please help me as I am on very critical point in my project.