Android Tutorial Pinch Zoom and Move View tutorial

Dominex

Active Member
Licensed User
Longtime User
I did not know that the POWER always returns a positive result, good to know.
Instead DENSITY is necessary otherwise when you touch the screen with two clicks of the image is resized, you can try by yourself.
 

Dominex

Active Member
Licensed User
Longtime User
I understand what you mean, though, although I do not much interest, those who use my code it is ready, you need only specify the View, inceve, especially the library Gesture Detector to program despite having more features. Personally I doubt that a true beginner face before Gesture Detector with respect to my code ready.

I'm thinking of converting my code in a class, it would be even easier.
 

Informatix

Expert
Licensed User
Longtime User

You probably used an automatic translation tool because I don't understand your answer. Could you send it again in your native language? I see the words Gesture Detector, so I presume you're comparing your code to my library. You should compare your code to the Warwound's library (TouchImageView), not to my library. My library has a different purpose; it eases the detection of gestures, nothing more.
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Instead DENSITY is necessary otherwise when you touch the screen with two clicks of the image is resized, you can try by yourself.

I re-did a few tests and, finally, I agree. The changes are more natural with "/density" and there are no "size jumps" when you put both fingers on screen. That was not obvious on my device, but on a different device, it's noticeable. Good point for you.

Doing a class is a good idea. I think that eases a lot the use of your code.
 
Last edited:

Dominex

Active Member
Licensed User
Longtime User
Volevo dire che sebbene ci sono delle librerie che fanno questo ed altro, usare il mio codice è semplice perché è già pronto, invece ad esempio la libreria Gesture Detector deve essere un minimo programmata.

I wanted to say that although there are libraries that do this and more, use my code is as simple as it is ready, however, for example the library Gesture Detector must be scheduled a minimum.
 

Dominex

Active Member
Licensed User
Longtime User
Well, now I'm just considering whether to add the rotation.
 

Informatix

Expert
Licensed User
Longtime User
however, for example the library Gesture Detector must be programmed a minimum.

Of course. It is a generic library. If you want to zoom something with the pinch gesture, you have to handle the increase/decrease in size, but that's not the most difficult part. Most users have no idea how to get the gesture itself, and do not know how to compute a distance with the Pythagoras theorem. The library is there to do these things for them. You are using yourself the Gestures library to do your stuff. My library is a complete replacement for this library. If you use my library, for example, your code will contain less lines of code and will be easier to understand than it is currently.
As I previously said, you should compare your code with the TouchImageView library, not with my library. The Warwound's library offers a lot more than your class, so you have to find something new to give your class some value, since you don't want to use it for an educational purpose. That's only my opinion, of course.
 

zeuspower

Member
Licensed User
Longtime User
It is what I was searching !

BUT

after zooming and paning how my user can get back easy the original size-place of image ?

because in my app the user selects images from a database,and after zooming and paning a image, the next image is a small mess !
 

Dominex

Active Member
Licensed User
Longtime User

You can easily get size and position simply by using a View said in Globals. For example:

B4X:
Sub Globals
   Dim PZ As PinchZoomMove
   Dim imv As ImageView
End Sub

Then get set and what you need with imv.Left, .Top, .Width, .Height.
 

susu

Well-Known Member
Licensed User
Longtime User
I just found that if I compile with "Release (obfuscated)" option, your class will not work. But it's not a big problem to me
 

Dominex

Active Member
Licensed User
Longtime User
I just found that if I compile with "Release (obfuscated)" option, your class will not work. But it's not a big problem to me
I know, I honestly do not really know how the compilation (obfuscated), I've never used it. But if you fill in "Release" will it work?
 

susu

Well-Known Member
Licensed User
Longtime User
Yes, it worked with "Release" option.
 

Dominex

Active Member
Licensed User
Longtime User
[UPDATE 1.4]

Added the "LongClick" event for the View.
Added methods "SetIfCanMove()" - sets whether the View may zoom or not.
Inserted also Library version in Zip Class.
Changed the type of data sent with the Click events and LongClick.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…