|
Post by benjamin805 on Jun 16, 2010 23:38:41 GMT -5
I was trying out the demo for the image323 and specifically the rotate command. I was thinking of using the feature to create a program to rotate a sprite image. When I used the demo that comes with the dll it seems that each time an image is rotated it gets bigger and bigger. I checked the code and did not see anything that would explain this issue. Could you explain this to me?
|
|
|
Post by Alyce Watson on Jun 17, 2010 5:51:59 GMT -5
I was trying out the demo for the image323 and specifically the rotate command. I was thinking of using the feature to create a program to rotate a sprite image. When I used the demo that comes with the dll it seems that each time an image is rotated it gets bigger and bigger. I checked the code and did not see anything that would explain this issue. Could you explain this to me? Yes, I can. Imagine a playing card, placed on a table, lined up with the edge of the table. Now rotate it 45 degrees. You must fit the image into a rectangular box that is lined up with the table edge. To do this, you'll have to create your new, rectangular box around the playing card in a larger size. If you rotate again, the rotation routine takes the new, larger rectangle and rotates THAT, creating an even larger rectangle, and so on. The demo images below may explain it graphically. See the bottom, right image. It began the same size as the other images, but rotated, it takes more space.
|
|
|
Post by benjamin805 on Jun 17, 2010 18:06:30 GMT -5
Alyce,
Thanks for the explaining. Is there a way that when I work with small images to have the image boarder or new rotated image stay the same size? or will I have to crop it in another program? For me whats happening is the image starts off in the upper left corner of the graphic window and after about 5 or 6 rotations it ends up in the lower right corner of my graphic box. Maybe you have not seen what I'm talking about. I'll post some pics if you don't get what I mean.
|
|
|
Post by benjamin805 on Jun 17, 2010 18:20:10 GMT -5
Here are some snapshots of what i mean. See how the whole image gets bigger?
|
|
|
Post by Alyce Watson on Jun 17, 2010 18:39:26 GMT -5
See how the whole image gets bigger? I tried to explain this. Yes, each time you rotate it the whole image will get bigger. If you stop and draw a border around each image before rotating it again, you might see it better. Have you tried rotating in another paint program? You'll see exactly the same thing. Rotation either creates a larger image, or cuts off corners of the image. Because bitmap images are rectangular, you need a bigger rectangle to hold a rotated image. Try it with a small picture frame. Try rotating it and fitting it within a second picture frame. You'll need a larger one. If you are attempting to make a sprite with many degrees of rotation, why not start with the same, original one each time and make a new copy for each rotation. original --> 20 degree rotated copy original --> 40 degree rotated copy original --> 60 degree rotated copy This will stop it from continuing to grow larger.
|
|