Solved

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

Posted on 1998-04-28
7
2,136 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Building cUrl in Windows v7.43.0 4 36
Header Errors LNK2019, LNK1120 - Unresolved Externals 4 187
gdb doesn't stop on breakpoint 2 93
Precision Problem in C++ 7 44
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

856 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