stupid graphics.drawrectangle
this is stupid.
VB Code:
gr.DrawRectangle(Pens.Red, New Rectangle(0, 0, 100, 100))
New Rectangle(0, 0, 100, 100)
this is supposed to make a rectangle with size 100x100 located at 0,0
Well when you try to DRAW that, it will draw a rectangle of size 101x101. STUPID!!!!
I had a similar problem with the drawing classes before, but I think it was about something else. I just wanna kill the VS developers. Why do they make so many stupid "mistakes"?!!!!
Re: stupid graphics.drawrectangle
Quote:
Originally posted by MrPolite
this is stupid.
VB Code:
gr.DrawRectangle(Pens.Red, New Rectangle(0, 0, 100, 100))
New Rectangle(0, 0, 100, 100)
this is supposed to make a rectangle with size 100x100 located at 0,0
Well when you try to DRAW that, it will draw a rectangle of size 101x101. STUPID!!!!
I had a similar problem with the drawing classes before, but I think it was about something else. I just wanna kill the VS developers. Why do they make so many stupid "mistakes"?!!!!
Ok, I am going out on a limb here...don't shoot me if I am off target.
You say that when you create a 100 X 100 rect with a 1 wide pixle pen, you get a rectangle that is 101 X 101. You then say that if you do a 100 X 100 rect with a 2 pixel pen, you get what your after...
Could it be that (as works with most imageing programs out there) that the border is being drawn on the next pixel out for odd number pen sizes, and dead center of the rectangle's lines for even number pen sizes.
So, if you did a 10 wide pen, 5 of the pixels would be on the inside of the rect, and 5 would be outside of it. This means that your rect would look like it was 90 X 90 inside dimensions, but a 110 X 110 outside dimensions. And if you did a 9 wide pen, you would get 4 pixels of the border on the inside of the rect, and 5 on the outside, therefore adding one to the size of the rect (even though it was created with the same 100 X 100 dimensions.
Just a thought I had, I have no facts to back it up...