如何使用java找出图像中心及其x,y坐标?

问题描述:

我正在尝试使用java语言旋转图像矩阵45,90,180,270和360

所以我将在下一个链接应用方程式来旋转矩阵



http://主页。 inf.ed.ac.uk/rbf/HIPR2/rotate.htm [ ^ ]



但我认为(x0,y0)是图像中心的坐标

i需要计算这个中心

如果有人能帮忙那就太棒了!



问候!

I'm trying to rotate image matrix 45,90,180,270 and 360 using java language
so i will apply the equations in next link to rotate matrix

http://homepages.inf.ed.ac.uk/rbf/HIPR2/rotate.htm[^]

but i think (x0,y0)are the co-ordinate of the center of image
i need to calculate this center
If anyone could help that would be great!

Regards!

中心很简单:

Center is easy:
X Center: X(Top Left) + (Width / 2)
Y Center: Y(Top Left) + (Height / 2)


在SO上看一下类似的问题:http://stackoverflow.co m / questions / 14300520 / rotate-image-in-overriden-paintcomponent-method [ ^ ]。在那里你会找到完整的代码;)
Have a look at similar question at SO: http://stackoverflow.com/questions/14300520/rotate-image-in-overriden-paintcomponent-method[^]. There you'll find complete code ;)