• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2346
  • Last Modified:

CDC::FillRect() and CDC::FillSolidRect()

Hi,
What is the major difference between CDC::FillRect() and the CDC::FillSolidRect() function in VC 4.0? I want to draw colored rectangles in a CView. I used CDC::FillRect() to draw them at the screen and CDC::FillSolidRect() to draw them at the printer. When I want to print my view in PostScript, these rectangles are not printed whereas it is working correctly in PCL5. Why?
Thanks
0
adnrwin
Asked:
adnrwin
  • 3
  • 3
1 Solution
 
adnrwinAuthor Commented:
Edited text of question
0
 
nietodCommented:
The  difference is that FillSolidRect() fills with a single, specified color.  FillRect() fills with a brush.  The brush COULD be a single solid color, but could be a dithered color, a pattern, a hatched brush etc.
0
 
nietodCommented:
If your brush is a solid brush, you should get the same results.  Is the printer a color printer?  If not the color you should fill with should be black or white, is it?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
adnrwinAuthor Commented:
It's a solid brush who is used with FillRect(). I've tried on both color and black/white printer. In either case, the result is the same : when I print in PostScript, the rectangles are not printed.
0
 
nietodCommented:
Have you tried GetDeviceCaps(DC,RASTERCAPS) to see if the PC_RECTANGLE flag is set.   If not, the device cannot draw rectangles.
0
 
adnrwinAuthor Commented:
The PC_RECTANGLE flag is set. I've tried to use FillRect() instead of FillSolidRect() when I'm printing and it's working correctly even in PostScript. What can make FillRect() able to print in PostScript whereas FillSolidRect() is not able?
0
 
jstolanCommented:
The problem is probably in your Post Script driver.  Not all drivers necessarily implement all of the CDC functions.  I know it's not exactly what you're looking for, but your best work around is to use FillRect when printing.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now