Click to See Complete Forum and Search --> : Transparent Ellipses?


September 1st, 1999, 10:16 AM
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

September 1st, 1999, 10:43 AM
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);

September 1st, 1999, 01:13 PM
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

September 1st, 1999, 01:31 PM
Just found the answer myself. FYI - you have to use CBrush::CreateBrushIndirect() and specify BS_HOLLOW as the style for LOGBRUSH.

Fisty
September 2nd, 1999, 09:29 AM
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.