PDA

View Full Version : dual display - single capture card (possible?)



damage
March 5, 2004, 21:51:19
Hello.

I would like to use the ICimage control twice on a single form to display the same captured image (live from tuner or composite) in 2 different areas.

For example I would like to show 2 areas (say left and right) both showing the tuner feed. Using VB6 and WinXp

Is this at all possible?

many thanks for your help,

best wishes,

damage.

Stefan Geissler
March 8, 2004, 08:01:04
Hello Damage,

You can use two IC Imaging Controls on one form, but you can not open one video capture device twice.

A solution could be one IC Imaging Control that acquires the video signal and a PictureBox that can be used to display the live video too.
In the ImageAvailable event sub of IC Imaging Control, the image is copied to the PictureBox:


Private Sub ICImagingControl1_ImageAvailable(ByVal BufferIndex As Long)
PictureBox.Pixture = ICImagingControl1.ImageBuffers.Item(BufferIndex).P icture
End Sub

damage
March 8, 2004, 11:31:52
Stefan,

thankyou for the quick reply.
I will try this out today and let you know how I get on.

It sounds as if it is exactly what I want though - I only want to show the same live image in a number of different locations.

Laters,

Damage.

damage
March 9, 2004, 09:15:40
Hello again Stefan,

I have tried your suggestion but do not seem to be having any luck.

My code is;

****************************
Private Sub ICImagingControl1_ImageAvailable(ByVal BufferIndex As Long)

Debug.Print Timer
Me.Picture1.Picture = Me.ICImagingControl1.ImageBuffers.Item(BufferIndex ).Picture

End Sub
****************************

I have used your 'Grabbing an Image' demo that comes with the control (v 1.41) and added a picturebox to it as you suggested. The picture is appearing in the control fine, but the ImageAvailable event seems to be doing nothing.

I am using VB6 sp5, WinXP Pro sp 1, Hauppauge WinTV USB Pro, DX9a with SDK installed

Many thanks again for any help,

best wishes,

Damage

Stefan Geissler
March 9, 2004, 09:25:05
Damage,

Before using the ImageAvailable event, you must set the properter ICImagingControl1.LiveCaptureContinous=true.

damage
March 9, 2004, 09:49:35
Bingo!
That works fine

Many thanks for your fast help.
Top job.

All the best,

Damage

Peter Bircher
March 9, 2004, 12:36:38
Is there an easy way to do the same in Delphi too?

In Delphi seems the Picture object to be an interface, and I don't find a way to get the picture from ICImagingcontrol.

Thanks!

Stefan Geissler
March 9, 2004, 12:49:27
Peter,

What is the Deplhi aequivalent to the PictureBiox of Visual Basic? Can you create a HDC on this thing? You could copy the image data with StretchDIBits to this thing. I have no Delphi expierences, so i need you help to create a sample.

Peter Bircher
March 9, 2004, 14:24:09
Dear Stefan,

I tried to copy with the following method, but the result was every time: 0 Lines copied!

procedure TfrmMainFrame.Button1Click(Sender: TObject);
var bild : OLEVariant;
bmi : BITMAPINFO;
NoOfLines : Integer;
begin
ICImagingControl.MemorySnapImage;
bild := ICImagingControl.MemoryGetDib;
with bmi.bmiHeader do
begin
biSize := SizeOf(bmi.bmiHeader);
biWidth := image1.Width;
biHeight := image1.Height;
biPlanes := 1;
biBitCount := 24; //DFK 31F03
biCompression := BI_RGB;
biSizeImage := 0;
biXPelsPerMeter := 1;
biYPelsPerMeter := 1;
biClrUsed := 0;
biClrImportant := 0;
end;
NoOfLines := StretchDIBits(image1.Canvas.Handle,
0,
0,
image1.Width,
image1.Height,
0,
0,
ICImagingControl.ImageWidth,
ICImagingControl.ImageHeight,
@bild,
bmi,
DIB_RGB_COLORS,
SRCCOPY);

showmessage(InttoStr(NoOfLines)+' Lines Copied');
end;

Thanks