I would advise calculating the scale of original image to screen
height/width, and adjusting your inSampleSize accordingly.  When it's
2, you're always loading half of the source bitmap, so if it's huge,
you're still loading half of huge.  You'll want to do something like
options.inSampleSize = srcWidth/screenWidth;
(maybe different, depending on your ratio, and if you want to fill the
screen, etc.  You might also want to round inSampleSize to the nearest
power of 2.

On Oct 4, 5:17 am, n2v2rda2 <l...@unimocnc.co.kr> wrote:
> with imageview and network-thread,i am making live cam-view ,bitmap
> size is "360 240",
> after parsing network-data to bitmap
>                 BitmapFactory.Options options = new BitmapFactory.Options();
>                 options.inSampleSize = 2;
>                 Bitmap orgBitmap = BitmapFactory.decodeByteArray();
>                 Bitmap bitmap = Bitmap.createScaledBitmap(orgBitmap, width, 
> height /
> 2 , true);
>
>                 if (bitmap != null) {
>                         Message msg = Message.obtain(handler, 0, current_ch, 
> 0, bitmap);
>                         handler.sendMessage(msg);
>                  }
>
> send bitmap by Message to ImageView.setImageBitmap(bitmap);
>
> all thing is good ,i can see live-cam
> but, to fit image in screen like "
> Bitmap.createScaledBitmap(orgBitmap, width, height / 2 , true)"
> Seeing bitmap is getting slow , the bigger bitmap is , the more speed
> down
> finally, shut-downed
>
> how to fit image in screen without pain

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to