This is a wrap of this library: https://github.com/MikeOrtiz/TouchImageView
Latest library (if anyone is interested) is here: GitHub
And will share it to you guys "as-is".
Initialize and set Image
Get ScrollPosition and ZoomedRect (Using JavaObject)
PS: If you like my work, donation is open for people would like to buy me a bread (not beer) lol!
Donate Now
Latest library (if anyone is interested) is here: GitHub
And will share it to you guys "as-is".
Initialize and set Image
B4X:
' add JSTouchImageView on your activity via code or from designer
Dim touchImage As JSTouchImageView
touchImage.Initialize("touchImage")
Activity.AddView(touchImage, 0dip, 0dip, 100%x, 100%y)
' set image bitmap
touchImage.setImageBitmap(LoadBitmap(File.DirAssets, "image.jpeg"))
Get ScrollPosition and ZoomedRect (Using JavaObject)
B4X:
Dim point As JavaObject = touchImage.ScrollPosition
Dim rect As JavaObject = touchImage.ZoomedRect
Dim currentZoom As Float = touchImage.CurrentZoom
Dim isZoomed As Boolean = touchImage.IsZoomed
LogColor($"x: ${point.GetField("x")} y: ${point.GetField("y")}"$, Colors.Blue)
LogColor($"left: ${rect.GetField("left")} top: ${rect.GetField("top")}"$, Colors.Blue)
LogColor($"right: ${rect.GetField("right")} bottom: ${rect.GetField("bottom")}"$, Colors.Blue)
LogColor($"currentZoom: ${currentZoom} isZoomed: ${isZoomed}"$, Colors.Blue)
PS: If you like my work, donation is open for people would like to buy me a bread (not beer) lol!
Donate Now
Attachments
Last edited: