CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    Transparent Ellipses?

    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


  2. #2
    Guest

    Re: Transparent Ellipses?

    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);






  3. #3
    Guest

    Re: Transparent Ellipses?

    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


  4. #4
    Guest

    Re: Transparent Ellipses?

    Just found the answer myself. FYI - you have to use CBrush::CreateBrushIndirect() and specify BS_HOLLOW as the style for LOGBRUSH.


  5. #5

    Re: Transparent Ellipses?

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured