2

I'm saving a bitmap to the internal storage through the compress() method.

The bitmap was first decoded from a byte array (from camera) so I'm assuming the bitmap factory would scale it depending on the screens density.

When I later decode the bitmap from a filestream; will it be scaled again with android assuming it as being for a medium density screen?

alain.janinm
  • 19,951
  • 10
  • 65
  • 112
Kieren Anderson
  • 508
  • 3
  • 16
  • you probably want to read this http://stackoverflow.com/questions/8494889/android-images-density-and-screen-pixels – Sergey Benner Jan 31 '12 at 10:36
  • also, are absolute pixel coordinates scaled even when placing an bitmap and specifying its width? – Kieren Anderson Jan 31 '12 at 10:51
  • depends also on how you define layout in the DP format then it's pixel independent. but the view.getWidth() may return more pixels on higher density screens. read also Additional Density Considerations in the http://developer.android.com/guide/practices/screens_support.html#DensityConsiderations. so reading the documentation it will be scaled if you define it as DP. which you usually want. – Sergey Benner Jan 31 '12 at 11:05
  • Yeah, Ive read over it a few times now, says it scales any absolute pixel coordinates. But is it referring to just layouts? Including the x,y of Canvas.drawBitmap() – Kieren Anderson Jan 31 '12 at 12:43
  • it won't scale unless you explicitly set it to be scaled. http://stackoverflow.com/questions/4925915/android-scaling-canvas-bitmap (fixed comment) – Sergey Benner Jan 31 '12 at 14:32

0 Answers0