PDA

View Full Version : refreshing text on video



sdecorme
June 4, 2008, 09:05:27
Hi
On my video the text or drawline are not refresh how can I delete them to refresh the data.
I use
private void SetupOverlay(TIS.Imaging.OverlayBitmap ob)
{
ob.Enable = true;
ob.FontTransparent = true;
}

and in a timer
ob.DrawText(Color.Blue, 0, 35, string.Format("W"));
or

ob.DrawLine(Color.Red, 40, 40, pos_X, pos_Y);

thanks

Stefan Geissler
June 4, 2008, 11:20:08
Hello,

Please try following functions:

private void timer1_Tick(object sender, EventArgs e)
{
if (icImagingControl1.LiveVideoRunning)
{
DisplayTime();
}
}

And now the time:

private void DisplayTime()
{
String TheTime = DateTime.Now.ToString("M/d/yyyy hh:mm:ss tt");

// Delete the current displayed time from the overlay.
icImagingControl1.OverlayBitmap.DrawSolidRect(icIm agingControl1.OverlayBitmap.DropOutColor , 10, 10, 120, 25);
// Draw the new time.
icImagingControl1.OverlayBitmap.DrawText(Color.Red ,10,10,TheTime);
}


The size of the rectangle for clearing the old time depends on the used font size.

sdecorme
June 4, 2008, 12:35:08
It works fine thank you