Image display incorrectly on phone, but correct on emulator.

All your problems with Audio, Video and Images.

Image display incorrectly on phone, but correct on emulator.

Postby Wing Eraser » Sat Jan 15, 2011 3:11 pm

As the topic says, the images on the emulator are displayed correctly but not on a real device.
Look at the screenshot:

Only look at the dpad, ignore the other objects on the image.

Emulator:
Image


HTC Desire HD
Image


I've to adjust the width and height by 1.5 to make it look properly, but the size than bigger ofcourse.
HTC Desire HD, size 1.5 bigger
Image


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Override
  2. public void onDraw(Canvas canvas)
  3. {
  4.         Bitmap _scratch = BitmapFactory.decodeResource(getResources(), R.drawable.player);
  5.         canvas.drawColor(Color.BLACK, PorterDuff.Mode.CLEAR);
  6.         Matrix matrix = new Matrix();
  7.         canvas.drawBitmap(_scratch, matrix, null);
  8. }
  9.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

This simply code draws a bitmap on screen. On the HTC it will be 1.5 bigger than the original image. The emulator shows correctly.

Anyone know the problem? I'll be grateful for any help offered.
Wing Eraser
Freshman
Freshman
 
Posts: 3
Joined: Sat Jan 15, 2011 2:54 pm

Top

Re: Image display incorrectly on phone, but correct on emula

Postby Wing Eraser » Sat Jan 15, 2011 4:25 pm

Fixed!
android:anyDensity="false"
Wing Eraser
Freshman
Freshman
 
Posts: 3
Joined: Sat Jan 15, 2011 2:54 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 21 guests