PDA

View Full Version : Borland C++ Builder and Overlay problem



cendof
January 24, 2011, 11:42:24
Hi,

I am using Borland Development Studio 2006 (yes, it is a little old) C++ and I have a project where also ActiveX component of ImagingControl is used. The LivePreview, capturing etc. is working just fine, but I can not draw anything on Overlay.

I tested a VB example - also the same ActiveX component:
Private Sub Form_Load()
With ICImagingControl1
.OverlayBitmap.Enable = True
.OverlayBitmap.ColorMode = 2
.LiveStart
ICImagingControl1.OverlayBitmap.DrawLine vbRed, 100, 100 - 10, 100, 100 + 10
End With
End Sub

This example works just fine, but in Builder nothing is drawn onto the live image. No error is reported. Does somebody has an example or any suggestions for solving this problem?

Thank you very much for the help.

Stefan Geissler
January 24, 2011, 14:06:11
Well, the problem is, that we do not know, how the code looks like in your C++.
You may try to enable the Overlay after the LiveStart call too.

cendof
January 24, 2011, 14:25:41
Hi,

my code in Borland C++ is now like this

void __fastcall TForm1::FormShow(TObject *Sender)
{
ICImagingControl_LiveImage->Device = "DMK 21F04";
ICImagingControl_LiveImage->DeviceUniqueName = "DMK 21F04 100A0400C";
ICImagingControl_LiveImage->OverlayBitmap->Enable = true;
ICImagingControl_LiveImage->LiveStart();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
ICImagingControl_LiveImage->OverlayBitmap->DrawLine(RGB(0,255,0),300,300-50,300,300+50);
}
//---------------------------------------------------------------------------


I tried also adding Enable = true after the LiveStart() but no luck. Maybe you have another idea or solution. I need to draw two lines on the live feed.

Thanks in advance.

Stefan Geissler
January 24, 2011, 16:45:50
Hi

First of all, you can use either
ICImagingControl_LiveImage->Device = "DMK 21F04";
or
ICImagingControl_LiveImage->DeviceUniqueName = "DMK 21F04 100A0400C";
using both makes no sense.

However, I have no idea, why the overlay is not shown. So we start playing around a little.
Please add the line
ICImagingControl_LiveImage->OverlayBitmapPosition = PATHPOSITION_DEVICE
before calling
ICImagingControl_LiveImage->OverlayBitmap->Enable = true;
ICImagingControl_LiveImage->LiveStart();

Drawing can be done as follows:
ICImagingControl_LiveImage->OverlayBitmapAtPath(PATHPOSITION_DEVICE)->DrawLine(RGB(0,255,0),300,300-50,300,300+50);

Maybe this does the job?

cendof
January 24, 2011, 17:55:41
Hi,

thank you for quick response. I will try your suggestions on Wednesday and than I will report the situation.

cendof
January 26, 2011, 08:34:28
Hi,

the OverlayBitmalAtPath does not accept extra parameter, so when the line

ICImagingControl_LiveImage->OverlayBitmapAtPath(PATHPOSITION_DEVICE)->DrawLine...

is added the compiler returns an error.

cendof
January 27, 2011, 08:17:44
Hi,

is there a possibility to make workaround and draw lines on TImage object that gets the frame from the Clipboard. Till now I can show picture from Clipboard

Image1->Picture->Bitmap->Assign(Clipboard());

But I don't know if TICImagingControl ActiveX object can store the frame in Clipboard as bitmap. Do you have any suggestions? Storing frame to file and then reopening it is too slow.

Stefan Geissler
January 28, 2011, 10:50:20
I am very sorry, but I had a little work overload, thus I was not able to
handle all issues in acceptable time.

However, IC Imaging Control only acquires images, but does not process them. Thus there are no
clipboard functions.