B4A Library [B4X][B4Xlib] lmB4XImageView

Modified version of Erel's B4XImageView - which is inside the "Xui Views" library.

It does not replace that, just add this to the additional libraries folder (B4X) and then choose whether to use in your project this or that.

The changes are two:

1 - I added the Click event - which also takes into account the possible rounding of the image, which is the most important feature of the B4XImageView, perhaps.
2 - Added also the classic properties: Left, Top, Width, Height.

V. 2.2.0
Added SaveBitmap.
Changed default BackgroundColor to transparent.

V. 2.1.2 Fixed a bug
V. 2.1.1 Fixed a bug in B4i
V. 2.1.0 Fixed a bug in B4i
This one. Thank you, @Alexander Stolte

V. 2.0.0 Please, read post #8
Removed B4A Touch event; it prevented the Click and LongClick events from being triggered.
Added LongClick event (not in B4J).

V. 1.2.0 Added Touch event.
Since the maximum number of parameters that can be passed using CallSub3 is two while the Touch event has three, I had to implement it like this:
Private Sub lmB4XImageView1_Touch (Action As Int, arrXY() As Float)
    Log("Action: " & Action)
    Log("X: " & arrXY(0))
    Log("Y: " & arrXY(1))
End Sub

V. 1.0.1 Fixed a bug


  • lmB4XImageView.b4xlib
    2.9 KB · Views: 52
Last edited:


Licensed User
Longtime User
Sorry, there are bugs.

I absentmindedly deleted the original and then, in the middle of the night, wrote again, too quickly, not enough tests.

I'll fix it soon - and maybe add a few more useful things.


Licensed User
Longtime User
V. 1.2.0 Added Touch event.
Unfortunately, the Touch event is incompatible with the Click and LongClick events; if the Touch event routine exists, Click and LongClick event routines will not fire.

So I decided to remove the Touch event and provide the Click and LongClick events, in version 2.0.0 (attached to the first post of this thread).