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.
"Yunus Emre ALPÖZEN [MCSD.NET]" wrote:
just use vs.net to import ocx
right click add reference choose com and browse and choose your ocx. vs.net
automatically calls tlbimp for u..
--
Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET
"javaid iqbal" <ja*******@yahoo.com> wrote in message
news:B0**********************************@microsof t.com... thanks for reply. can you please send me some web pointer where i read how
to
use tlbimp.
"Yunus Emre ALPÖZEN [MCSD.NET]" wrote:
u can use tlbimp for interop conversion.
But my advice u just use "add reference; COM tab" VS.NET will use tlbimp
it
for u..
--
Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET
"javaid iqbal" <ja*******@yahoo.com> wrote in message
news:30**********************************@microsof t.com...
>i want to use video.ocx for reading camera in my program. i was using it
>very
> succesfully in VB 6.0. Can some body guide me how to use it in CSharp.
> Thanks in Advance.