For testing purposes, I would suggest you temporarily put the camera code
aside, and do some testing on a simply image loaded from resources. My
reason for saying this is to remove any possible outside issues, and just
concentrate on the scaling of an image. I see your code, which seems like it
*should* work, although we can't see how you form the 'matrix' variable,
which may be the problem.
This code, for example, worked fine for me (logo is 141 x 36, a JPG):
---
// Scale twice as high:
Bitmap logo = BitmapFactory.decodeResource(getResources(), R.drawable.logo);
Matrix m = new Matrix();
m.postScale(1.0f, 2.0f, logo.getWidth() * 0.5f, logo.getHeight() * 0.5f);
logo = Bitmap.createBitmap(logo, 0, 0, logo.getWidth(), logo.getHeight(), m,
true);
---
Once you can satisfy yourself that the actual scaling is working as
expected, then you can start looking for outside problems - such as how you
generate 'matrix', for example. It would also be worth drawing the picture
you get from your camera as-is, alongside the result of your attempts to
'correct' it, to make sure your source picture is actually coming through
the way you think it is. You'll kick yourself if you find it's already
coming through rotated or something!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en