Phylum Posted January 7, 2004 Posted January 7, 2004 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 Quote
*Experts* Bucky Posted January 7, 2004 *Experts* Posted January 7, 2004 Are you perhaps filling the region with a brush after drawing the border? Because the pen's width straddles the actual border of the Region, it's possible that the fill is overlapping the pen. If so, just do the filling before drawing the border. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Phylum Posted January 8, 2004 Author Posted January 8, 2004 nope. I fill then draw the border.... Quote
*Gurus* divil Posted January 8, 2004 *Gurus* Posted January 8, 2004 You should decrease the width and height of the rectangle by 1 before drawing the border - it's just the way rectangles and pixels work on windows. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Phylum Posted January 14, 2004 Author Posted January 14, 2004 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. Quote
*Experts* Bucky Posted January 14, 2004 *Experts* Posted January 14, 2004 Are you sure you're 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. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.