Rotating images wit odd pixel sides length
what is the best approach of solving this problem:
If you have an image whose sides are even for example 48 x 24 you may do this and you are just fine:
开发者_如何学编程matrix.translate(-24, -12);
matrix.rotate(Math.PI);
matrix.translate(24, 12);
But if you have an image of size something like 49 x 25, then there is a problem with those odd pixels, how to compute when and where to add or remove those odd pixels so image gets allways perfectly rotated?
Thank you for any help!
Just translate by -24.5 and -12.5, etc, instead of -24 and -12.
精彩评论