Question

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??

Was it helpful?

Solution

Canvas, Bitmaps and such are in Pixels.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top