On Android 1.6 my wallpaper applications resize the wallpapers correctly,
however on Android 2.1 the resizing doesn't work, its the same on the
emulator.
I've tried using both the Matrix and Bitmap.createScaledBitmap both do
exactly the same and work find on 1.6. Can anyone explain what is happing
and why these routines don't work on Android 2.1?
I start off by getting the device screen size using:
Display display = app.getWindowManager().
getDefaultDisplay();
m_intScrWidth = display.getWidth();
m_intScrHeight = display.getHeight();
I load the image from a resource with:
m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
m_intImgWidth = m_bmpImage.getWidth();
m_intImgHeight = m_bmpImage.getHeight();
m_fltSFbyHeight = (float)m_intScrHeight / (float)m_intImgWidth;
Then to scale the image:
m_intFinalWidth = (int)((float)m_intImgWidth * m_fltSFbyHeight);
m_intFinalHeight = (int)((float)m_intImgHeight * m_fltSFbyHeight);
Thank you,
Simon
--
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