Recent

Author Topic: Android and zoom with 2 finger control  (Read 715 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2090
    • Lazarus and Free Pascal italian community
Android and zoom with 2 finger control
« on: October 25, 2019, 12:05:30 pm »
Hi guys, I have the following need. Display an image (the source is in base64) and then be able to zoom the image perhaps using the classic 2-finger control. Are there any examples to do this?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2090
    • Lazarus and Free Pascal italian community
Re: Android and zoom with 2 finger control
« Reply #1 on: October 28, 2019, 09:49:53 am »
No suggestion?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jmpessoa

  • Hero Member
  • *****
  • Posts: 1530
Re: Android and zoom with 2 finger control
« Reply #2 on: October 28, 2019, 06:25:18 pm »

Hi, xinyiman!

You can try the demo "AppPinchZoomGestureDemo1"
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

xinyiman

  • Hero Member
  • *****
  • Posts: 2090
    • Lazarus and Free Pascal italian community
Re: Android and zoom with 2 finger control
« Reply #3 on: October 29, 2019, 08:31:56 am »
Now I look this example.

Thank you very much  ;)

Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2090
    • Lazarus and Free Pascal italian community
Re: Android and zoom with 2 finger control
« Reply #4 on: October 29, 2019, 12:25:49 pm »
Hi jmpessoa, I tried the example and it works pretty well. Only two things

1. the image should resize as I move my fingers and not to release

2. the image should zommare even if it exceeds the dimensions of the panel, but facnedo see only the part on which I acted with the fingers

Is there such an example?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jmpessoa

  • Hero Member
  • *****
  • Posts: 1530
Re: Android and zoom with 2 finger control
« Reply #5 on: October 30, 2019, 09:18:44 pm »

Hi, xinyiman!

Sorry, at the moment I dont have another "zoom" demo App...

but you can try pack your image in a html format and try load it using


jWebView1.LoadFromHtmlString(....)

or

jWebView1.LoadFromHmtFile(....)

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

xinyiman

  • Hero Member
  • *****
  • Posts: 2090
    • Lazarus and Free Pascal italian community
Re: Android and zoom with 2 finger control
« Reply #6 on: November 05, 2019, 10:08:35 am »
I did a lot of testing but I couldn't get the zoom solution correctly. I think the problem is that the jImageView component always scales the image to be displayed. Isn't there a way to see the unscaled image? Then I'll do the related resizing. Or if you have other suggestions, they are welcome.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018