Borders

Phylum

Well-known member
Joined
Jun 20, 2003
Messages
105
Location
Canada
When drawing a border (using a pen object) around a region within a controls bounds something odd happens. Let say you use a size of 5 for the thickness of the pen and the region is a rectangle. The top and left lines of the border seem to be thicker than the bottom and right lines. Even more mysterious is it seems to go away with certain pen sizes (10). Why is this? I encountered this when creating my own shape control and I have downloaded several others and they seem to have the same problem.

Phylum
 
Are you perhaps filling the region with a brush after drawing the
border? Because the pens width straddles the actual border of
the Region, its possible that the fill is overlapping the pen. If
so, just do the filling before drawing the border.
 
You should decrease the width and height of the rectangle by 1 before drawing the border - its just the way rectangles and pixels work on windows.
 
The control size is let say 50X50 i reduce the region (rectangle) to 45X45 and then draw a border with thickness of 3. The same problem occurs.
 
Are you sure youre doing the things in the correct order?
Make sure that you first draw fill, then resize the rectangle, and
finally draw the border, in that order.
 
Back
Top