-
[안드로이드] bitmap too large to be uploaded into a texture android안드로이드(java)/에러 관련 2019. 10. 24. 12:52
bitmap too large to be uploaded into a texture android
이미지 크기가 많이 큰 파일을 이용해야 할 일이 생겨서 넣고 빌드했는데 위와 같은 에러가 나왔습니다.
Manifest.xml에서 hardwareAccelerated 를 false로 값을 주면 정상적으로 작동 하긴 합니다.
하드웨어 가속을 사용하지 않는다면 이렇게 해도 되지만
하드웨어 가속 true 상태로 사용하고 싶다면 두 가지방법 중 하나를 선택해야 할 것같습니다.
1. 사용중인 이미지의 사이즈를 축소
2. Bitmap을 이용해서 축소 시키기
1번의 경우는 새롭게 만들던지 구해야 할 것 같고...
2번은 아래처럼 사용하시면 될 것 같습니다.
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.imgfile);
Bitmap resized = Bitmap.createScaledBitmap( bitmap, 원하는 넓이, 원하는 높이, true );
img.setImageBitmap(resized);
'안드로이드(java) > 에러 관련' 카테고리의 다른 글