문제

what canvas.drawBitmap unit(DIP, PX, ...???) want for x and y parameter and also what unit will return when call Bitmap.getWidth() is it in DIP OR PIX OR ....???

i want to create backgammonboard game, when i create board, i am re size original image, and i check original image and re sized image and check percentage, and draw dices, but my problem still it is not work properly in all device, just work fine in my device that programmed in...

i think i confused DIP and PX and Bitmap.getWidth() has diffrent unit that canvas.drawBitmap wants...

UPDATE i put backgammonboard image in drawable-mdpi it has 858Px but when i use ((BitmapDrawable) this.getResources().getDrawable(R.drawable.backgammonboard)).getBitmap().getWidt‌​h() it will rerutn 1287Px why??

도움이 되었습니까?

해결책

Canvas, Bitmaps and such are in Pixels.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top