views:

75

answers:

1

While rotating a bitmap using matrix, vertex is not stable..

  Matrix matrix = new Matrix();
    matrix.postRotate(mDegree,100,100);
    mCompasstemp = Bitmap.createBitmap(mCompPic, 0, 0, mCompPic.getWidth(), mCompPic.getHeight(), matrix, true);
    mCompassHud.setImageBitmap(mCompasstemp);

Output of my code is like -bitmap will rotate. -vertex of my bitmap is not stable. -Bitmap is resizing

I need disable image resizing and make the rotation stable.Can you please suggest a solution for this?

A: 

Not sure if this is what your looking for but it might help.

Android uses its built in compatibility features to scale and render a bitmap appropriately for screens with different pixel densities. There are two methods of scaling, pre-scaling and auto-scaling.

It will pre-scale bitmaps' from resources and auto-scales when the bitmap is being drawn internally (which is what your doing be using createBitmap).

Go to http://developer.android.com/guide/practices/screens_support.html and check under: 4.Use density and/or size-specific resources: Pre-scaling and auto-scaling of bitmaps and nine-patches