1

surfaceview を bitmap にコピーしたいのですが、黒色 (ff000000) を取得するだけです

    //this.surView is my SurfaceView 
    Bitmap bitmap =Bitmap.createBitmap(this.surView.getWidth(), this.surView.getHeight(),      Bitmap.Config.RGB_565); 
      //this.can is my canvas
    this.can = this.surHolder.lockCanvas(new  Rect(0,0,this.surView.getWidth(), this.surView.getHeight()));
     this.can.setBitmap(bitmap);
     this.surView.draw(this.can);
     this.surHolder.unlockCanvasAndPost(can);
       // bitmap = Bitmap.createBitmap(bitmap);
                  //copy bitmap from (srcx,srcy) to (x,y) 
        bitmap = Bitmap.createBitmap(bitmap, srcx, srcy, cx, cy);

        this.ondrawImage(bitmap, x, y);
4

1 に答える 1

-2

を使用して surfaceview.getDrawingCache()ビットマップを取得します。

于 2012-12-01T04:57:50.557 に答える