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. CDC::FloodFill and Printer

CDC::FloodFill and Printer

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
7 Posts 4 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

    FloodFill doesn't works on printer. Are there other solution to colorized a ellipse? I need your help many thanks

    B 1 Reply Last reply
    0
    • J jerome_data

      FloodFill doesn't works on printer. Are there other solution to colorized a ellipse? I need your help many thanks

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

      Why not just use CDC::Ellipse() Just create a CBrush with the characteristics you need for the fill, a CPen for the border (if any), select them into the DC, and then call the CDC::Ellipse function. How are you drawing the ellipse now that requires the use of CDC::Floodfill?

      J 1 Reply Last reply
      0
      • B bob16972

        Why not just use CDC::Ellipse() Just create a CBrush with the characteristics you need for the fill, a CPen for the border (if any), select them into the DC, and then call the CDC::Ellipse function. How are you drawing the ellipse now that requires the use of CDC::Floodfill?

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

        Because the ellipse is use to graphic chart pie and i have many colors in the ellipse for each part. I haven't idea how to fill each part inside my ellipse. Maybe used fillrgn but i don't know how do this?

        D 1 Reply Last reply
        0
        • J jerome_data

          Because the ellipse is use to graphic chart pie and i have many colors in the ellipse for each part. I haven't idea how to fill each part inside my ellipse. Maybe used fillrgn but i don't know how do this?

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

          Can you FloodFill() to an in-memory DC, and than copy that to the printer's DC?


          "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

            Can you FloodFill() to an in-memory DC, and than copy that to the printer's DC?


            "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
            #5

            i do this directly on my printer (i print my view) void myview::OnPrint(CDC *pDC, CPrintInfo *pInfo) { if (!pDC || !pInfo) return; pDC->Ellipse(p1.x-(int)r,p1.y-(int)r,p1.x+(int)r,p2.y+(int)r); pDC->FloodFill(p3.x,p3.y,0x0); ..... } In fact i draw all with my current pen: ellipse, part of pie and i do floddfill to fill each part. must i used CreateCompatibleDC?

            D M 2 Replies Last reply
            0
            • J jerome_data

              i do this directly on my printer (i print my view) void myview::OnPrint(CDC *pDC, CPrintInfo *pInfo) { if (!pDC || !pInfo) return; pDC->Ellipse(p1.x-(int)r,p1.y-(int)r,p1.x+(int)r,p2.y+(int)r); pDC->FloodFill(p3.x,p3.y,0x0); ..... } In fact i draw all with my current pen: ellipse, part of pie and i do floddfill to fill each part. must i used CreateCompatibleDC?

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

              jerome_data wrote:

              must i used CreateCompatibleDC?

              As I'm not much into GDI, I do not know. It wouldn't hurt to try, though.


              "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
              • J jerome_data

                i do this directly on my printer (i print my view) void myview::OnPrint(CDC *pDC, CPrintInfo *pInfo) { if (!pDC || !pInfo) return; pDC->Ellipse(p1.x-(int)r,p1.y-(int)r,p1.x+(int)r,p2.y+(int)r); pDC->FloodFill(p3.x,p3.y,0x0); ..... } In fact i draw all with my current pen: ellipse, part of pie and i do floddfill to fill each part. must i used CreateCompatibleDC?

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

                You can use GetDeviceCaps to see if the device supports your drawing operations. if (pDC->GetDeviceCaps(RASTERCAPS) & RC_FLOODFILL) // flood fills are supported ... if (pDC->GetDeviceCaps(CURVECAPS) & CC_PIE) // pie wedges are supported ... etc. If they aren't supported by the printer device then you may need to do your drawing to a memory DC and blit it to the printer DC. Mark

                "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