View Full Version : Overlay draw circle
February 26, 2004, 21:15:51
How can I draw the overlay circle in solid color and line
February 27, 2004, 13:12:04
With OverlayBitmap::getDC() you can retrieve the drawing DC of the OverlayBitmap object. With this, you can use the Windows GDI functions to draw circles.
ob = m_Grabber.getOverlay();
hDC = ob->getDC();
if( hDC != NULL)
// Now, perform some GDI functions with the hDC
HPEN hPen, hPenOld;
HBRUSH hBrush, hBrushOld;
hPen = CreatePen(PS_SOLID,1, color);
hBrush = CreateSolidBrush( color );
hPenOld = (HPEN)SelectObject(m_hDC, hPen);
hBrushOld = (HBRUSH)SelectObject( m_hDC, hBrush);
Ellipse( hDC, rect.left, rect.top, rect.right, rect.bottom );
DeleteObject( hPen );
color is a vaild RGB color, rect is an rectangle, which is used to draw the ellipse. The ellipse is filled (solid).
March 3, 2004, 18:40:48
How to work in Visual Basic & Not in solid ??
March 4, 2004, 08:51:19
See the "I want to draw a non solid circle thread" in the ActiveX forum.
April 22, 2004, 20:52:34
After I draw the circle in the center , I cannot detect the pixel data which coverd by that circle any more !! What Can I do Now ??
April 22, 2004, 21:01:17
April 23, 2004, 14:53:44
If you draw in the overlay, it is copied completely on the frame. The original frame pixel data are overwritten.
April 23, 2004, 17:03:04
How can I get the same result ?????
April 26, 2004, 08:38:46
What do you mean with "the same result"? If i understand you correctly, you want to draw some graphics on the live video without deleting the old contents of the live video. Is this correct?
If i am right, i attached to one of our threads a sample, that uses a CListener class that displays the live video image after you had time to process it. It uses an own displaying method on the display window DC. This DC can be used, to draw any other graphical elements, without overdrawing the original memory buffer.
Please let me know, what you want to do. Thank you.
April 26, 2004, 14:01:59
you are right !!!
April 27, 2004, 12:50:54
You saw my entry in http://www.theimagingsourceforums.com/showthread.php?s=&threadid=315934
It shows how to solve your problem in C and in VB
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.