Suppose I want to draw 2 squares, side by side and such that they
overlap over a common edge. I would do something like this:...
dc = wxPaintDC(self)
...
dc.DrawRectangle(0, 0,10,10)
dc.DrawRectangle(10,0,10,10)
...i.e., draw 2 squares 10 pixels wide.
Yes. However, "10 pixels wide" means X from 0 to 9, and Y from 0 to 9. when
you start drawing at (10,0), you are NOT overlapping.
wxWindows uses the Windows standard for shapes: shapes never include their
right or bottom edges.
Now, If I print the drawing, the two squares are perfectly aligned; but
on screen it looks like the common edge is wider than the other edges.
The common edge is wider in both cases. I'm guessing it looks perfectly
aligned on the printer only because the resolution is so much finer: two
pixels are 1/300th of an inch on your printer, but 1/36th of an inch on your
monitor.
On the other hand, if I do:
...
dc.DrawRectangle(0, 0,10,10)
dc.DrawRectangle(11,0,10,10)
...then the squares looks ok on screen but not in paper
What do you see on paper?
There really are two alternatives: you can either draw the rectangles 11,11
(so that 10 pixels get touched), or you can use DrawLines instead of
DrawRectangle. The latter is probably the better solution; by using
rectangles, you are touching almost every pixel twice.
···
On Wed, 04 Sep 2002 17:55:21 -0700, Juan Pablo Romero <jpablo@kan.ajusco.upn.mx> wrote:
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.