Ok, so I figured out how to resize bitmaps, but now I am trying to
figuare out how to resize a Media (which plays a gif...unless there is
a better way to play gifs?).

For those looking on how to resize a bitmap do the following:

1. get the width and height of screen/view.
2. set a ratioWidth var to ScreenWidth/WidthDevelopedFor
3. set a ratioHeight var to ScreenHeight/HeightDevelopedFor
4. then in your bitmap after you decode the resource, next do
Bitmap.createScaledBitmap. In the new x do
BitmapVar.getWidth()*ratioWidth and in the new y do
BimapVar.getHeight()*ratioHeight.

Hope that helps.


So, back to my question, how do you resize some Media class? I was
thinking canvas.scale and canvas.translate, but that really isnt
working. Again..if there is a better way to play gifs, i am all ears.

Thanks.

On Feb 26, 10:21 am, Scott Deutsch <[email protected]> wrote:
> Hello Group,
>
> I was wondering how do you scale a bitmap to look good on any screen size
> (Using surfaceview and canvas). I already know the canvas width and canvas
> height. So, what would the calculation be?
>
> Example lets say I have a picture that is 100x100 and the phone size is
> 1920x1200 (just for the sake of it). Now when displaying that on the phone,
> it will look small. So, how do i scale that up to be bigger based on the
> aspect ratio or resolution. Just say the developed phone resolution was
> 480x854 (so all pics was created after that res).
>
> So, if the resolution is smaller i want to scale the bitmap down, and if it
> is bigger, i want to scale it up.
>
> Any feedback is appreciated, thanks.

-- 
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

Reply via email to