1

I have an application on Google Play published 4 or 5 months ago. The images had shown fine until the last samsung update.

In one part of the code I'm using the following function:

void android.graphics.Canvas.drawBitmap (Bitmap bitmap, Rect src, Rect dst, Paint paint)

The problem is that since the update does not behave as before about the margins when the src parameter are smaller than dst.

Before

BEFORE http://www.pegastacus.com/img/others/before_margins_ok.png

After

AFTER http://www.pegastacus.com/img/others/after_margins_bad.png

The value of the params are:

bitmap = A scaled bitmap from BitmapFactory.decodeResource of 328x222 px.

src = [-76, -289, 404, 511]

dst = the entire screen [0,0,480,800]

As you see, the margins should be 76px for left and right and 289px for top and bottom.

Why this suddenly change of behavior? I am lost. Anyone have any idea??

Community
  • 1
  • 1
Pegastacus
  • 31
  • 5

1 Answers1

0

Well,

The solution for me has been to change the function drawBitmap for this one

void android.graphics.Canvas.drawBitmap(Bitmap bitmap, float left, float top, Paint paint);

more simple and, with appropriate parameters, I get the same result as above.

Apparently there is no problem with the margins and the image is drawn as it should.

Pegastacus
  • 31
  • 5