public void Image_Location(ImageView img,int x,int y) //이미지 좌표 리사이즈
{
if(img.getParent().toString().contains("RelativeLayout"))
{
RelativeLayout.LayoutParams params=null;
params=(RelativeLayout.LayoutParams)img.getLayoutParams();
params.leftMargin=(int) (x*Draw_rate);
params.topMargin=(int) (y*Draw_rate);
img.setLayoutParams(params);
System.out.println("OKAY RE");
img.invalidate();
}
else if(img.getParent().toString().contains("LinearLayout"))
{
LinearLayout.LayoutParams params=null;
params=(LinearLayout.LayoutParams)img.getLayoutParams();
params.leftMargin=(int) (x*Draw_rate);
params.topMargin=(int) (y*Draw_rate);
img.setLayoutParams(params);
img.invalidate();
}
else if(img.getParent().toString().contains("FrameLayout"))
{
FrameLayout.LayoutParams params=null;
params=(FrameLayout.LayoutParams)img.getLayoutParams();
params.leftMargin=(int) (x*Draw_rate);
params.topMargin=(int) (y*Draw_rate);
img.setLayoutParams(params);
img.invalidate();
}
}
public void Image_ReSize(ViewGroup View,int width,int height) //이미지 크기 리사이즈
{
LayoutParams params=null;
params=(LayoutParams)View.getLayoutParams();
params.width=(int)(width*Draw_rate);
params.height=(int)(height*Draw_rate);
View.setLayoutParams(params);
}
이런식으로 화면 별로 크기를 리사이즈 해주고 배치하고있는데
프레임 레이아웃에 이미지뷰 를 넣고 프레임레이아웃 크기를 이미지뷰의 크기 만큼 만들어서 넣었습니다.
화면 안에 배치되여 있으면서 실행하면 이상없이 잘출력이되는데
화면안에 배치되어있지 않고 중간정도 밖에 나가있으면 그만큼 짤려서 보이더군요 그래서 출력해보니까 실제로 레이아웃 값도 짤린만큼 작아져있었습니다. 왜 이런현상이 일어나는거죠 ? 기능상 화면 밖에서 안으로 들어오는 레이아웃인데 ..
이미지가 잘려버려서 난감합니다.