有没有一种方法可以旋转字节数组而不将其解码为位图?
目前在jpeg PictureCallback中,我只是将字节数组直接写入文件。但图片是旋转的。我想旋转它们,而不是解码为位图,希望这将保存我的记忆。
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeByteArray(data, 0, data.length, o);
int orientation;
if (o.outHeight <
我很难让我的弹丸--在这种情况下,是箭头--在抛物线弧线中旋转,就像它应该旋转一样。它在旅行时根本不旋转,直到它与某物相撞。
下面是我使用的相关代码。
public class Arrow extends BodyDef{
private Body body;
public Arrow(float x, float y, float halfWidth, float halfHeight, float rotation, float velocity) {
type = BodyDef.BodyType.DynamicBody;
position.set(x, y);