![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
mx.RotateAt(angle, New PointF(CSng((PictureBox1.Image.Width - 1) / 2), CSng((PictureBox1.Image.Height - 1) / 2))) 'Rotates CW about the specified point |
#3
| |||
| |||
|
|
" active" <activeNOSPAM (AT) a-znet (DOT) com> wrote in message news:%23BK6xeMoHHA.4424 (AT) TK2MSFTNGP03 (DOT) phx.gbl... mx.RotateAt(angle, New PointF(CSng((PictureBox1.Image.Width - 1) / 2), CSng((PictureBox1.Image.Height - 1) / 2))) 'Rotates CW about the specified point Why are you subtracting 1? Michael |
#4
| |||
| |||
|
|
Doesn't affect this problem. I tried it without first. Just want to see if it changed anything. I shouldn't have left it in. I also tried different widths. 100 works the same as 99. |
#5
| |||
| |||
|
|
" active" <activeNOSPAM (AT) a-znet (DOT) com> wrote in message news:OwloZ6ToHHA.5052 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Doesn't affect this problem. I tried it without first. Just want to see if it changed anything. I shouldn't have left it in. I also tried different widths. 100 works the same as 99. It worked perfectly on mine. For a 100x100 bitmap I need to rotate around 50,50. For a 101x101 bitmap I can rotate around 50.5,50.5 to get the correct result. Try putting the PointF into a var and checking to make sure it has the correct values. Michael Got this after I sent the copy of my display. |
#6
| |||
| |||
|
|
mx.RotateAt(angle, New PointF(CSng((PictureBox1.Image.Width) / 2), CSng((PictureBox1.Image.Height) / 2))) |
#7
| |||
| |||
|
|
" active" <activeNOSPAM (AT) a-znet (DOT) com> wrote in message news:OtPC4hYoHHA.2452 (AT) TK2MSFTNGP02 (DOT) phx.gbl... mx.RotateAt(angle, New PointF(CSng((PictureBox1.Image.Width) / 2), CSng((PictureBox1.Image.Height) / 2))) I missed the problem the first few times I read this. First I should say that using the extra set of brackets around Image.Width is unnecessary and makes the code more confusing (it confused me for sure!). Anyway, the problem is you are dividing by 2 and then converting to single. This will do an integer divide, hence dropping the decimal part. Convert to width to single first and then divide by 2. |
|
Also, are you using PixelOffsetMode.Half? |
|
Michael |
#8
| ||||||
| ||||||
|
|
You do C#, riight? |
|
In VB we have "/" which results in a Double and "\" which does integer devision. |
|
No I was not, and when I set it the problem went away. Isn't it strange that it affected the right side but not the botton. Since the example was completely simmetrical one might expect an operation would not treat X any differently then Y. |
|
Is PixelOffsetMode.Half something that I should use regulary? |
|
What about SmoothingMode. Should I be setting this before operations like "Rotate" |
|
Thanks a lot for sticking throught this for me! I really appreciate it. |
#9
| |||
| |||
|
|
" active" <activeNOSPAM (AT) a-znet (DOT) com> wrote in message news:O$gL6DboHHA.1776 (AT) TK2MSFTNGP05 (DOT) phx.gbl... You do C#, riight? That's true although I came from Vb6. In VB we have "/" which results in a Double and "\" which does integer devision. That was true for VB6 but not for vb.net. In vb.net if both sides of the division are integers then it will do an integer divide (hence it is irrelevant whether you use / or \). If you try it with 11 and 2 the result will be 5 when you really want 5.5. |
#10
| |||
| |||
|
|
I believe 5 \ 2 will return type integer equal to 2 but Dim n As Double = 5 Dim d As Double = 2 n / d will return a type double equal to 2.5 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |