여쭈어 보고 싶은거 있는 완전 초보 입니다.
자바는 안배운 관계로 완전 모르고 c는 기초만 압니다.

제가 원하는 부분은 이미지 뛰우고 맵을 드래그 하면서 창에서 볼수 있게끔 할려 합니다
아래 소스 부분 드래그 하는 부분을 찾은거 같은데요
이미지 뛰운 상태에서 맵을 드래그 하면서 볼수 있겠금 하고 싶습니다. (폰 창에 맵이 너무 작게 나와서요)

아래 소스와 그 아래 소스를 연동하고 싶은데 어떻게 하는건가요 ??

또한 colorball 이라는게 뭔지?? 궁금 합니다.


public boolean onTouchEvent(MotionEvent event) {
    int eventaction = event.getAction();
   
    int X = (int)event.getX();
    int Y = (int)event.getY();

    switch (eventaction ) {

    case MotionEvent.ACTION_DOWN: // touch down so check if the finger is on a ball
      for (ColorBall ball : colorballs) {
           // check all the bounds of the ball
            if (X > ball.getX() && X < ball.getX()+50 && Y > ball.getY() && Y < ball.getY()+50){
                balID = ball.getID();
                break;
            }
          }
         
         break;


    case MotionEvent.ACTION_MOVE:   // touch drag with the ball
      // move the balls the same as the finger
        colorballs[balID-1].setX(X-25);
        colorballs[balID-1].setY(Y-25);
       
         break;

    case MotionEvent.ACTION_UP:
           // touch drop - just do things here after dropping

         break;
    }
    // redraw the canvas
    invalidate();
    return true;
 
}



참고로 아래 소스는 이미지 띄운 부분 입니다. (딸랑 이미지 하나 있습니다.)
========================================================================================================

package com.dongguk.map.dongguk;

import com.dongguk.map.R;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.MotionEvent;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout.LayoutParams;

 

public class map extends Activity {
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        LinearLayout linLayout = new LinearLayout(this);
       
        // load the origial BitMap (500 x 500 px)
        Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(), R.drawable.donggukmap);
       
        int width = bitmapOrg.getWidth();
        int height = bitmapOrg.getHeight();
        int newWidth = 400;
        int newHeight = 400;
       
        // calculate the scale - in this case = 0.4f
        float scaleWidth = ((float) newWidth) / width;
        float scaleHeight = ((float) newHeight) / height;
       
        // createa matrix for the manipulation
        Matrix matrix = new Matrix();
        // resize the bit map
        matrix.postScale(scaleWidth, scaleHeight);
        // rotate the Bitmap
        matrix.postRotate(0);

        // recreate the new Bitmap
        Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,
                          width, height, matrix, true);
   
        // make a Drawable from Bitmap to allow to set the BitMap
        // to the ImageView, ImageButton or what ever
        BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);
       
        ImageView imageView = new ImageView(this);
       
        // set the Drawable on the ImageView
        imageView.setImageDrawable(bmd);
     
        // center the Image
        imageView.setScaleType(ScaleType.CENTER);
       
        // add ImageView to the Layout
        linLayout.addView(imageView,
          new LinearLayout.LayoutParams(
                      LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT
                )
        );
       
        // set LinearLayout as ContentView
        setContentView(linLayout);
    }
}