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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to fill a ellipse

How to fill a ellipse

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
9 Posts 5 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.
  • J Offline
    J Offline
    jerome_data
    wrote on last edited by
    #1

    How do you fill a ellipse on a CDC without Floodfill? thanks

    D 1 Reply Last reply
    0
    • J jerome_data

      How do you fill a ellipse on a CDC without Floodfill? thanks

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Select a different-colored brush into the DC before drawing. There's also FillRect().


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      B 1 Reply Last reply
      0
      • D David Crow

        Select a different-colored brush into the DC before drawing. There's also FillRect().


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        B Offline
        B Offline
        bob16972
        wrote on last edited by
        #3

        Can you use FillRect() for an Ellipse or was that a morning glitch? I'm having those myself this morning. :)

        D J M 3 Replies Last reply
        0
        • B bob16972

          Can you use FillRect() for an Ellipse or was that a morning glitch? I'm having those myself this morning. :)

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          bob16972 wrote:

          Can you use FillRect() for an Ellipse...

          I guess not. I was just assuming you'd give it a starting point somewhere within the shape and it would fill until it reached the edges. I guess that's what FloodFill() is for! :-O


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          • B bob16972

            Can you use FillRect() for an Ellipse or was that a morning glitch? I'm having those myself this morning. :)

            J Offline
            J Offline
            jerome_data
            wrote on last edited by
            #5

            thanks yes it's very easy to fill a ellipse with current selected brush. in fact my problem it's to do a pie chart. I draw a pie chart with 3 parts. How i can fill with colore each parts??

            D 1 Reply Last reply
            0
            • J jerome_data

              thanks yes it's very easy to fill a ellipse with current selected brush. in fact my problem it's to do a pie chart. I draw a pie chart with 3 parts. How i can fill with colore each parts??

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              jerome_data wrote:

              I draw a pie chart with 3 parts. How i can fill with colore each parts??

              Can you call Pie() three times, using a different brush each time? [edit] I just tried this and it worked fine. [/edit]


              "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              J 1 Reply Last reply
              0
              • D David Crow

                jerome_data wrote:

                I draw a pie chart with 3 parts. How i can fill with colore each parts??

                Can you call Pie() three times, using a different brush each time? [edit] I just tried this and it worked fine. [/edit]


                "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                J Offline
                J Offline
                jerome_data
                wrote on last edited by
                #7

                yes it's work very fine thanksssss i need to do now a code to calculate coordinate point from a percent value. thanks

                M 1 Reply Last reply
                0
                • J jerome_data

                  yes it's work very fine thanksssss i need to do now a code to calculate coordinate point from a percent value. thanks

                  M Offline
                  M Offline
                  Michael Dunn
                  wrote on last edited by
                  #8

                  jerome_data wrote:

                  i need to do now a code to calculate coordinate point from a percent value.

                  See this article[^]

                  --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?

                  1 Reply Last reply
                  0
                  • B bob16972

                    Can you use FillRect() for an Ellipse or was that a morning glitch? I'm having those myself this morning. :)

                    M Offline
                    M Offline
                    Mark Salsbery
                    wrote on last edited by
                    #9

                    bob16972 wrote:

                    Can you use FillRect() for an Ellipse

                    Sure you can! It has the side-effect of squaring off the ellipse's corners though ;)

                    "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

                    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