简体   繁体   English

两点之间的Android缩放

[英]Android Scaling between two points

I'm trying to calculate and scale an image between 2 points. 我正在尝试计算和缩放2点之间的图像。 I'm using the e3roid engine for Android. 我正在为Android使用e3roid引擎。 Here is my code 这是我的代码

 double dx   = as.getRealX() - laser1.getRealX();          
    double dy   = as.getRealY() - laser1.getRealY();
    laser1.scale(2, (float)Math.sqrt(dx * dx + dy * dy));

When I test it the image just doesn't show up at all. 当我对其进行测试时,图像根本不会显示。 I made sure that the 2 images that it is scaling between are created first but no avail. 我确保首先创建要缩放的2张图像,但无济于事。 Thanks for the help if you help me! 多谢您的协助!

I fixed it. 我修好了它。 I just needed to convert the angle to radians. 我只需要将角度转换为弧度即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM