PDA

View Full Version : OverlayBitmap Text problem on Y8 LiveDisplay



DFranklin
May 5, 2004, 23:52:53
I am having problems with the Overlay.Bitmap property on the LiveDisplay when the ICImagingControl1.MemoryCurrentGrabberColorformat = ICY8. If I start the LiveDisplay in ICY8 then the Overlay.Bitmap Text works fine and displays properly on the LiveDisplay. However If I then change ICImagingControl1.MemoryCurrentGrabberColorformat to ICRGB24 and display some text using OverLay.Bitmap on the LiveDisplay and then go back to ICImagingControl1.MemoryCurrentGrabberColorformat = ICY8, the Overlay.Bitmap Text is no longer showing on the LiveDisplay.

Below is a sample of the code I am trying to run:

NOTE - the default setting for ICImagingControl1.MemoryCurrentGrabberColorformat is ICRGB24,
ICImagingControl1.LiveDisplay = False, ICImagingControl1.VideoFormat = "UYVY (1280x960)", and BW = False

--------------------------------------------------------------------------------

Option Explicit
Dim BW As Boolean


'
'Command Button BW Click
'
Private Sub cmdBW_Click()

If BW = False Then 'Black and White button has not been pressed or the Color function is enabled
ICImagingControl1.LiveStop
BW = True
cmdBW.Caption = "COLOR"
With ICImagingControl1
.MemoryCurrentGrabberColorformat = ICY8 'Set ICImagingControl1 to Black and White (Y8)
.LiveStart
'Draw Overlay text indicating that the live display is black and white
.OverlayUpdateEventEnable = True
.OverlayBitmap.Enable = True
.OverlayBitmap.Font.size = 24
.OverlayBitmap.DrawText RGB(255, 255, 255), 1130, 200, "B/W"
End With

Else 'The Black and White function is enabled, lets change it to color
ICImagingControl1.LiveStop
BW = False
cmdBW.Caption = "B/W"
With ICImagingControl1
.MemoryCurrentGrabberColorformat = ICRGB24 'Set ICImagingControl1 to color (ICRGB24)
.LiveStart
'Draw Overlay text indicating that the live display is color
.OverlayUpdateEventEnable = True
.OverlayBitmap.Enable = True
.OverlayBitmap.Font.size = 24
.OverlayBitmap.DrawText RGB(255, 0, 0), 1130, 7, "Color"
End With
End If

End Sub

Stefan Geissler
May 6, 2004, 07:45:43
Hello,


I tested your code with a DFK 21F04 and Sony XCD SX 910. Therefore i
needed to change the text display coordinates to 10/10. Your code works without any error with both
cameras. I suggest to change your coordinates as mentioned above and test again.
Also it would be a good idea to set the dropoutcolor property of the overlay bitmap to 0. May be
this solves your problem.

DFranklin
May 6, 2004, 22:08:27
Thanks Stefan, but unfortunately those settings you mentioned were ones that I had originally tried but did not work. Nevertheless I put them back in and tested but to no avail. However I have noticed something strange that I don't think is by design. If I enter some OverlayBitmap text on the LiveDisplay say at coordinates 10,10 and then add some more OverlayBitmap text at say 100,10, both OverlayBitmap Texts are displayed on the live window, not the outcome I had in mind, since I only want either one of the two displayed on the LiveDisplay not both. If this is in fact normal, is there anyway to "release" the OverlayBitmap from the LiveDisplay between OverlayBitmap text "functions"? If so, I think this may solve my original problem

Stefan Geissler
May 7, 2004, 07:18:16
Hello,

The overlay bitmap is just a bitmap (HBITMAP). If you draw text on this bitmap, it is drawn with the GDI function "TextOut" on the bitmap. If different text is written on the same place, the previous written text is not deleted and will be combined with the new text. The text will blur.
You can set the text background color to the dropout color of the overlay bitmap. Then you set the texttransparent to false. This avoid the blurring of text. You should append some blanks after your text, in case of new text is shorter than the previously written text..

To clear the entire overlay bitmap, just fill (Method "Fill") with the dropout color.

While the video format or the sinktype is not changed, the overlay bitmap is not deleted and created new by IC Imaging Control.

DFranklin
May 21, 2004, 05:08:22
Thanks for that and sorry for not posting anything sooner.

I was able to resolve my original problem by using overlaybitmap within 2 different procedures. What I did was first, place an unimportant text message at coordinates that would put the bitmap outside the resolution of the live display within the procedure that changed the live display from ICRGB24 to ICY8. Then whenever I called the procedure that actually put the necessary information on the Y8 livedisplay, it would work. Also your last post helped me clear up the blurred text I was getting. Thanks.