Android Tutorial [B4X] B4XImageView - ImageView + resize modes

B4XImageView is a new custom view, added to XUI Views v2.40.

It adds several useful resize modes to the standard ImageView:

1597820737069.png


(Images source:
)

The bitmaps are never resized, only the internal ImageView is resized. This allows the actual image resizing to be done with hardware acceleration.

All of the resize modes, except of FILL, preserve the image ratio.
The modes are: FIT, FILL, FILL_NO_DISTORTIONS, FILL_WIDTH, FILL_HEIGHT and NONE.

The attached example demonstrates all mode.
B4XImageView also supports clipping the image to a circle. Note that there is a difference in the behavior of this feature between the platforms, when the view is not square.
 

Attachments

Back
Top