View Full Version : How can Link the framready() result show in overlayCallback()

April 21, 2004, 21:10:10
I try to use framready to check the pixel data & show the result in callback function, What can I do ???

void CListener::frameReady( Grabber& param, smart_ptr<MemBuffer> pBuffer, DWORD currFrame)

void CListener::overlayCallback( Grabber& param, smart_ptr<OverlayBitmap> pBitmap, const tsMediaSampleDesc& MediaSampleDesc)

How can I Link these two function ??

Stefan Geissler
April 22, 2004, 08:34:19
Hello Webmice,

The Overlay Callback is performed before the frameready is performed. Therefore it is not possible to display results from frameReady with the Overlaycallback in the currently processed frame. In this case, i suggest to draw every frame in the frameReady method with StretchDIBits and draw your texts, lines and marks in the same HDC, where the Frame has been stretched in. To do this, startlive must called with the parameter false to avoid the live display.

Just perform you image processing on the membuffer and then display the membuffer as shown in one of our last threads.
Use GDI functions (textout, MoveToEx, LineTo ...) to display graphics on the frame.

April 22, 2004, 17:18:06
Understand your point , Can you send me some sample about that ??

Stefan Geissler
April 23, 2004, 14:59:23
Hello Webmice,

see the attached sample. The Listener.cpp contains what you need. In CListener::DrawBuffer after the image is drawn on the DC, you can perform the other GDI functions on the same DC.