2012-03-30 51 views
0

我在繪製圖像時遇到問題。我如何繪製精確的圖像。我想在觸摸屏幕的地方繪製圖像。我如何做到這一點?我實現了座標的onTouch方法,但我不知道如何在這個地方繪製圖像。ImageView在精確座標系中繪製圖像

+0

您想直接在畫布上繪製圖像或只能創建(移動)一些ImageView的聯繫協調的形象呢? – 2012-03-30 05:52:36

+0

我只想在我點擊的位置繪製圖像,然後在該圖像上使用動畫。之後我可以更好地使用動畫。畫布可以動畫一些圖片? – edi233 2012-03-30 05:55:44

回答

1

做到像下面畫

class Panel extends View { 

     public Panel(Context context) { 
      super(context); 
     } 

     @Override 
     public void onDraw(Canvas canvas) { 
      Bitmap _scratch = BitmapFactory.decodeResource(getResources(), R.drawable.calvin_logo_small); 
      canvas.drawColor(Color.WHITE); 
      canvas.drawBitmap(_scratch, x-point, y-point, null); 
     } 
    }