Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC: Drawing Overlapping Circles

MFC: Drawing Overlapping Circles

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicshelptutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TechAvtar
    wrote on last edited by
    #1

    Hi, I am trying to draw two circles, which are overlapping . My problem is that the second circle is hiding the first one partially. I want to see both circles completely. Can somebody guide me what parameter should I tweak? afx_msg void DemoWin::OnPaint () { CPaintDC dc(this); CRect myRect; /* Define rectangle coordinates */ myRect.top = 0; myRect.left = 0; myRect.bottom = 200; myRect.right = 100; dc.Ellipse(myRect); myRect.top = 100; myRect.left = 50; myRect.bottom = 200; myRect.right = 200; dc.Ellipse(myRect); } Thanks Jacob

    C K 2 Replies Last reply
    0
    • T TechAvtar

      Hi, I am trying to draw two circles, which are overlapping . My problem is that the second circle is hiding the first one partially. I want to see both circles completely. Can somebody guide me what parameter should I tweak? afx_msg void DemoWin::OnPaint () { CPaintDC dc(this); CRect myRect; /* Define rectangle coordinates */ myRect.top = 0; myRect.left = 0; myRect.bottom = 200; myRect.right = 100; dc.Ellipse(myRect); myRect.top = 100; myRect.left = 50; myRect.bottom = 200; myRect.right = 200; dc.Ellipse(myRect); } Thanks Jacob

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      TechAvtar wrote:

      My problem is that the second circle is hiding the first one partially. I want to see both circles completely.

      What do you mean exactly ? :confused: You want the colors of the two circles to be merged ? For instance one circle is white and the other one is white, then the intersection should be gray ?

      Cédric Moonen Software developer
      Charting control [v2.0] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • T TechAvtar

        Hi, I am trying to draw two circles, which are overlapping . My problem is that the second circle is hiding the first one partially. I want to see both circles completely. Can somebody guide me what parameter should I tweak? afx_msg void DemoWin::OnPaint () { CPaintDC dc(this); CRect myRect; /* Define rectangle coordinates */ myRect.top = 0; myRect.left = 0; myRect.bottom = 200; myRect.right = 100; dc.Ellipse(myRect); myRect.top = 100; myRect.left = 50; myRect.bottom = 200; myRect.right = 200; dc.Ellipse(myRect); } Thanks Jacob

        K Offline
        K Offline
        KingsGambit
        wrote on last edited by
        #3

        You can select a NULL brush to the device context before drawing the ellipse. ... dc.SelectObject(GetStockObject(NULL_BRUSH)); dc.Ellipse(myRect); ...

        T 1 Reply Last reply
        0
        • K KingsGambit

          You can select a NULL brush to the device context before drawing the ellipse. ... dc.SelectObject(GetStockObject(NULL_BRUSH)); dc.Ellipse(myRect); ...

          T Offline
          T Offline
          TechAvtar
          wrote on last edited by
          #4

          Thanks .This was I looking for.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups