Solved

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

Posted on 1998-04-28
7
2,057 Views
Last Modified: 2012-05-04
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
Comment
Question by:adnrwin
  • 3
  • 3
7 Comments
 

Author Comment

by:adnrwin
ID: 1165979
Edited text of question
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165980
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
 
LVL 22

Expert Comment

by:nietod
ID: 1165981
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:adnrwin
ID: 1165982
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
 
LVL 22

Expert Comment

by:nietod
ID: 1165983
Have you tried GetDeviceCaps(DC,RASTERCAPS) to see if the PC_RECTANGLE flag is set.   If not, the device cannot draw rectangles.
0
 

Author Comment

by:adnrwin
ID: 1165984
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
 
LVL 2

Accepted Solution

by:
jstolan earned 50 total points
ID: 1165985
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now