Monday, April 30, 2012

Re: [android-developers] Fitting image to a screen

And if you're about to question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).
Do you happen to have a link to said thread?  I have done image scaling before and have never run into this... My constraints were slightly different though... I simply scaled the image so that it was as large as possible while maintaining the aspect ration.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Mon, Apr 30, 2012 at 3:26 PM, Mohamed ElSanousi <mmurtada57@gmail.com> wrote:


 Your joking, my whole project is depending. I need to resize this bitmap to fit the screen size, because I want to do calculation on the picture :(


On Tue, May 1, 2012 at 1:21 AM, Jim Graham <spooky130u@gmail.com> wrote:
On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote:
> On Tue, May 1, 2012 at 12:16 AM, Justin Anderson <magouyaware@gmail.com>wrote:
> > On Mon, Apr 30, 2012 at 1:56 PM, Mohamed ElSanousi <mmurtada57@gmail.com>wrote:
> >
> > I want the selected picture that is passed to the new activity to fit the
> > > screen size. I want to resize the bitmap to fit the screen exactly.
> >
> > Well, then you would need some code to get the actual pixel dimensions of
> > the screen... right now you have hardcoded values of 750.  Keep in mind
> > that doing this will cause distortion of the image... It will look
> > stretched either in width or height.
>
>  Oh ok. And how will I get the actual pixel dimensions of the screen? I
>  really need your help

I hate to dissapoint you, but as I learned some time ago, you can't.  No
matter what you do, the image will always be stretched beyond the limits
of the screen.  That's just how Android does it.  And if you're about to
question that, I got this directly from Dianne Hackborn in a thread I
started over a year ago (maybe two...I'm not even sure now).

Later,
  --jim

--
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)        | Peter da Silva:  No, try "rm -rf /"
spooky130u@gmail.com    | Dave Aronson:    As your life flashes before
< Running FreeBSD 7.0 > |      your eyes, in the unit of time known as an
ICBM / Hurricane:       |      ohnosecond....     (alt.sysadmin.recovery)
  30.44406N 86.59909W  |

Android Apps Listing at http://www.jstrack.org/barcodes.html

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate