View Full Version : OverlayBitmapPosition Issue

February 2, 2007, 08:30:53

I need to use and switch between two OverlayBitmap paths: PATHPOSITION_DEVICE and PATHPOSITION_DISPLAY

I did some test with LiveCaptureContinuous True and watched to images in OnImageAvailable event with all four pathpositions:
1) PATHPOSITION_NONE: overlay in live - no, in images - no -> OK
2) PATHPOSITION_DEVICE: overlay in live - yes, in images - yes -> OK
3) PATHPOSITION_SINK: overlay in live - no, in images - don't know, because no OnImageAvailable events ocuured -> FAIL
4) PATHPOSITION_DISPLAY: overlay in live - no, in images - no -> FAIL

What is wrong with PATHPOSITION_DISPLAY ?

Jarda Jedlinsky

Stefan Geissler
February 2, 2007, 09:16:59
Hi Jarda

What is wrong with PATHPOSITION_DISPLAY ?

(Sorry, must edit my post, i misunderstood your question.)

The Overlay in the Displaypath is created LiveStart has been called.

Please try following. Your Form_load should be:

Private Sub Form_Load()
' Check whether a valid video capture device has been selected,
' otherwise show device settings dialog.
If Not ICImagingControl1.DeviceValid Then

If Not ICImagingControl1.DeviceValid Then
MsgBox "No device was selected."
Unload Me
Exit Sub
End If
End If

ICImagingControl1.OverlayBitmapPosition = PATHPOSITION_DISPLAY
ICImagingControl1.OverlayBitmapAtPath(PATHPOSITION _DISPLAY).Enable = True

' This sample works works for color images, so set the sink type
' to RGB24
ICImagingControl1.MemoryCurrentGrabberColorformat = ICRGB24
End Sub

After LiveStart has been called, you can perform your drawings in the Overlaybitmap:

Private Sub cmdStartLive_Click()
Dim OV As OverlayBitmap

Set OV = ICImagingControl1.OverlayBitmapAtPath(PATHPOSITION _DISPLAY)

OV.DrawText RGB(255, 0, 0), 10, 10, "Hello World!"

End Sub

Stefan Geissler
February 2, 2007, 09:23:51

you may download the sample from the attached link down.

February 5, 2007, 11:45:26
Hello Stefan,

thank you for quick and working answer. My work with OverlayBitmap was wrong. I draw to .OverlayBitmap only, used .OverlayBitmap.Enable and set .OverlayBitmapPosition with my path type.

Correct way is your way: draw to .OverlayBitmapAtPath[PATH], use Enable/Disable with .OverlayBitmapAtPath[PATH].Enable and set .OverlayBitmapPosition to wanted path.

Stefan Geissler
February 5, 2007, 17:58:56
Hi Diram,

Thank you for your feedback. I must surrender, sometimes it is a little bit confusing with the Overlaybitmap.