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 に答える