Image zoom in/out problem

Put your problem here if it does not fit any of the other categories.

Image zoom in/out problem

Postby prashantkspatil » Fri Mar 19, 2010 8:30 am

hello,

I am developing an application to show image and it should support scrolling and zoom in/out.

So I used a custom view to draw bitmap and handle touch events to scroll it.
But I have a problem while zooming in or out the bitmap,
It woks fine for 1020X600 bitmap but it gives an exception while using 1020X718 bitmap.

I show the bitmap fit to height of the screen and zoom in to its original height.
I used following code
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.                 bmp = Bitmap.createScaledBitmap(original, newWidth, newHeight, true);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

for 1020X718 image it woks fine for first time zoom in and out but if I try it again it throws an exception.

Please help me, If another way is possible please suggest it.

Thanks in advance.
prashantkspatil
Junior Developer
Junior Developer
 
Posts: 12
Joined: Fri Mar 19, 2010 8:15 am
Location: Pune

Top

Postby pskink » Fri Mar 19, 2010 8:38 am

see how i have done this here:

http://www.anddev.org/download.php?id=1933
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 15 guests