CDC::FloodFill and Printer
-
FloodFill doesn't works on printer. Are there other solution to colorized a ellipse? I need your help many thanks
-
FloodFill doesn't works on printer. Are there other solution to colorized a ellipse? I need your help many thanks
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?
-
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?
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?
-
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?
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
-
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
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?
-
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?
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
-
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?
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