开发者

Rotating images wit odd pixel sides length

开发者 https://www.devze.com 2023-01-11 13:10 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消