Solved

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

Posted on 1998-04-28
7
2,215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

623 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