Hi,
Does anyone know of a simple way to create transparent ellipses? The CDC::Ellipse() function only seems to support filled ellipses. I've thought about using a series of bezier curves. Does anyone know a different approach?
Thanks,
Jon
Printable View
Hi,
Does anyone know of a simple way to create transparent ellipses? The CDC::Ellipse() function only seems to support filled ellipses. I've thought about using a series of bezier curves. Does anyone know a different approach?
Thanks,
Jon
The help for CDC::Ellipse says that the interior is filled with the current brush. So if you don't want the interior filled try this:
CBrush* oldBrush=pDC->SelectObject((CBrush*)NULL);
pDC->Ellipse(rect);
pDC->SelectObject(oldBrush);
Thanks, Anonymous, for the help. Your suggestion sort of works. The problem now is that I need the background to be black. The current method causes it to be white. I'll keep trying other options, but if anyone has more suggestions I'd appreciate it.
Thanks,
Jon
Just found the answer myself. FYI - you have to use CBrush::CreateBrushIndirect() and specify BS_HOLLOW as the style for LOGBRUSH.
One way of doing it is to use paths in the device context...
pDC->BeginPath()
Draw your elipse
pDC->EndPath()
pDC->StrokePath()
Check those out and see if that works any better.