First timer help on image manipulation?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

First timer help on image manipulation?

Postby bollix » Sat Apr 04, 2009 10:27 pm

Hi,

I have managed to display an image but I wish to be able to zoom it if I can.

I have searched to see how to make the zoom controls work but so far have not managed to do so, also all I seem to find is references to the zoom controls being used with the Google Maps view?

I am trying to give the same sort of functionality as the android pictures app when actually viewing the image where the zoom controls allows the user to zoom around the image.

Could someone help me please?

Thanks
bollix
Freshman
Freshman
 
Posts: 8
Joined: Sat Apr 04, 2009 10:19 pm

Top

Postby bollix » Thu Apr 16, 2009 11:50 am

*bump*

Anyone?
bollix
Freshman
Freshman
 
Posts: 8
Joined: Sat Apr 04, 2009 10:19 pm

Postby Hebus » Thu Apr 16, 2009 1:37 pm

You can do that by :
- Creating an ImageView widget and handling onTouch events for panning
- Creating your zoom widget ( linear layout with two buttons), handling the onclick event for the zoomin and zoomout buttons.
- use the following function for changing what is displayed in the image :
Matrix.setRectToRect(sourceRect, destinationRect, Matrix.ScaleToFit.FILL); where sourcerect is a RectF selecting what you want to display on your image and destinationRect is the imageView widget size.
ImageView.setImageMatrix(Matrix);

I use it in a project I'm currently writting and it works fine
Last edited by Hebus on Thu Apr 16, 2009 3:26 pm, edited 1 time in total.
Hebus
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Apr 15, 2009 1:10 pm

Postby bollix » Thu Apr 16, 2009 2:55 pm

Excellent!

thanks for the information, I will try this and report back.

thanks again
bollix
Freshman
Freshman
 
Posts: 8
Joined: Sat Apr 04, 2009 10:19 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 9 guests