2

捕获的图像存储在横向位置,因此我想将其更改为肖像。

如何在不使用位图的情况下做到这一点?如果我使用下面的代码图像会损坏。所以只有我不想使用位图。

我的代码是:

Bitmap Out = null;
Bitmap Output = null;

Out = BitmapFactory.decodeByteArray(data, 0, data.length);
int w = Out.getWidth();
int h = Out.getHeight();
 Matrix mtx = new Matrix();
mtx.postRotate(90);

             Output = Bitmap.createBitmap(Out, 0, 0, w, h, mtx, true);
               image = bitmaptoByte(Output);
4

1 回答 1

0

RotateAnimation 为例,我旋转秒针:

public RotateAnimation createAnimation(float time) {
      RotateAnimation rotateAnimation = new RotateAnimation(time, time,  Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF, 0.5f);
      rotateAnimation.setFillAfter(true);
      return rotateAnimation;

  public void runSec(float shour) {
      csecond.startAnimation(createAnimation(shour*6));
    }
于 2013-01-09T12:15:14.643 回答