안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요^^
제가 연습삼아 이미지를 불러와서 터치를 인식해 그림이 움직이게 하는 부분을 공부중인데요.
public void surfaceCreated(SurfaceHolder holder) {
// window 크기
pWindow = new Point();
pWindow.x = 320;
pWindow.y = 480;
// 이미지 위치
pImage = new Point(0, 0);
//BitmapFactory.Options options = new BitmapFactory.Options();
//options.inSampleSize = 2;
Resources res = getResources();
tempBitmap = BitmapFactory.decodeResource(res, R.drawable.gmf);
imgWidth = 100;
imgHeight = 160;
// 표시할 위치
moveX = pWindow.x / 2;
moveY = pWindow.y / 2;
// 이미지 그리기
imgMove = Bitmap.createScaledBitmap(tempBitmap, imgWidth, imgHeight, true);
setClickable(true);
thread = new Thread(this);
thread.start();
}
이미지를 불러오는 소스를 이렇게 사용했는데, 왜 /res/drawable-hdpi 폴더안의 gmf.png 파일이 읽어지지 않고
icon.png 파일이 불러지게 되는지 궁금합니다.
혹시나 이미지 사이즈가 커서 그런가 해서 option으로 사이즈 조정도 해보고 했는데 안되더군요.ㅠㅠ
해주실 수 있는 조언이 있으시다면 댓글 남겨주셔요 ㅠㅠ
감사합니다!!!!




글쎄요.. 소스상에 딱히 문제점이 보이지는 않는데.. clean 후 재 빌드 해보시거나 gmf이미지 파일에 문제가 없는지 확인해보세요