Gesture Bitmap View
View used to display a bitmap allowing gestures to change view zooming, panning and rotation.
Parameters
Android context.
XML layout attributes.
style to be used.
Types
Default values and constants shared by GestureBitmapView instances.
Indicates the modes the image can be initially scaled.
Interface to draw on top of the displayed image.
Interface defining bottom bound reached event.
Interface defining double tap event.
Interface defining events raised while an image set through an ImageSource is loaded.
Interface defining left bound reached event.
Interface defining maximum scale reached event.
Interface defining minimum scale reached event.
Interface defining right bound reached event.
Interface defining an event to notify completion of rotation and translation animation.
Interface defining an event to notify completion of scale animation.
Interface defining an event to notify completion of scroll animation.
Interface defining top bound reached event.
Properties
Duration of animations to complete rotation, scale and translation expressed in milliseconds.
Gets matrix containing base transformation that was applied to the image (expressed in image pixels) because of current display type.
Gets base transformation parameters that were applied to the image (expressed in image pixels) because of current display type.
Gets or sets bitmap. When setting background bitmap using this method, transformation is reset, and the current imageSource, if any, is closed. While an imageSource is set this property is null.
Listener to handle bottom bound reached events raised by this view.
Bottom scroll margin expressed in pixels. Defines the amount of bounce when bottom scroll limit is reached.
Memory budget expressed in bytes for the decoded resolution levels of an image set through an ImageSource. DEFAULT_CACHED_LEVELS_MEMORY_BUDGET (default value) means 4 times the number of pixels of the view, 4 bytes each. Changing it reconfigures the current image.
Gets rectangle, expressed in display coordinates, where the image is displayed after applying the full display transformation matrix.
Gets overall transformation matrix to transform image pixels into display coordinates. This takes into account base and current transformation matrices.
Gets overall transformation parameters that were applied to transform image pixels into display coordinates. This takes into account base and current transformation parameters.
Gets or sets display type to use when image is initially displayed. When display type is changed, display matrix is preserved (adjusting scale and scroll as needed).
Indicates whether double tap is enabled or not to make a fast jump in scale.
Listener to handle double tap events raised by this view.
Indicates whether scroll using two fingers is exclusive. When this property is true, and both scrollEnabled and twoFingerScrollEnabled are also true, then scroll is disabled with one finger and can only be done with two fingers. If false and both scrollEnabled and twoFingerScrollEnabled, then scroll can be made with both one or two fingers.
Indicates whether images set through an ImageSource are decoded as hardware bitmaps. Hardware bitmaps are only used when this property is true and the view is hardware accelerated. Changing it reconfigures the current image.
Listener to handle events raised while an image set through an ImageSource is loaded.
Drawer invoked after the image has been drawn, to draw on top of it.
Gets or sets the source of the image to display. Setting it replaces any previous bitmap or source and resets transformation. The previous source is closed, and so is the one set here when it is replaced later or the view is given another image, so it must not be used by the caller afterwards.
Indicates whether antialiasing is enabled or not.
Listener to handle left bound reached events raised by this view.
Left scroll margin expressed in pixels. Defines the amount of bounce when left scroll limit is reached.
Margin on maximum scale so that a bounce effect happens when maximum image scale reaches the limit.
Listener to handle maximum scale reached events raised by this view.
Margin on minimum scale so that a bounce effect happens when minimum image scale reaches the limit.
Listener to handle minimum scale reached events raised by this view.
Indicates whether images set through an ImageSource are decoded by regions at several resolutions (true), or decoded whole at their full resolution (false). Changing it reconfigures the current image.
Listener to handle right bound reached events raised by this view.
Right scroll margin expressed in pixels. Defines the amount of bounce when right scroll limit is reached.
Listener to handle events raised by this view when rotate and translate animation completes. This is only notified when rotation and translation are animated back to their initial values together with the scale, which happens when double tap returns the view to its minimum scale. It is not notified when a gesture ends below the minimum scale, because in that case only scale is animated back to the minimum (rotation is kept and translation is brought back within its scroll limits).
Indicates whether rotation gesture is enabled or not.
Indicates whether a rotation gesture keeps rotating the bitmap with decaying speed after the fingers are released (rotation fling), when they were rotating fast enough. The fling starts when the last finger is lifted, provided it is lifted shortly after the rotation ends (within 150 ms), and it replaces any scroll fling made by that same release. This only applies when rotationEnabled is true. If the scale is out of its limits when the gesture ends, the scale correction animation takes precedence and no rotation fling is kept.
Listener to handle events raised by this view when scale animation completes.
Indicates whether scale gesture is enabled or not.
Jump in scale factor to be applied when doing a double tap gesture.
Listener to handle events raised by this view when scroll animation completes.
Indicates whether scroll gesture is enabled or not.
Amount of tension (resistance) applied when the bitmap is dragged beyond its scroll limits and scrollTensionEnabled is true. Each outward finger movement is multiplied by (1 - overscroll / margin)^scrollTension. A value of 1 (default) makes resistance grow linearly with the overscroll. Larger values make resistance grow faster (stiffer feel), values between 0 and 1 make it softer, and 0 removes tension so that the bitmap follows the finger until the hard margin.
Indicates whether tension is applied when the bitmap is dragged beyond its scroll limits. When true, dragging past the un-margined bound is progressively resisted up to the corresponding scroll margin (rubber-band effect). When false, the bitmap follows the finger until the hard margin is reached.
Listener to handle top bound reached events raised by this view.
Top scroll margin expressed in pixels. Defines the amount of bounce when top scroll limit is reached.
Gets matrix containing current transformation parameters applied to base matrix to display current image. Parameters are expressed in image pixels.
Gets or sets current transformation parameters used to display the image respect the base transformation applied by current display type. When setting transformation parameters, no limits are imposed on scale or translation to ensure the bitmap remains visible within the view.
Indicates whether scroll with two fingers is enabled or not. When both scrollEnabled and this property are enabled, user can scroll the bitmap with two fingers.
Functions
Notifies that the contents of the displayed image have changed, so that it is drawn again. When the image comes from an ImageSource its decoded levels are refreshed in background. When the image is a bitmap, the view is just invalidated. Nothing is done without image.
Maps a point expressed in view coordinates into upright image pixels.
Called when a touch event occurs on the view.
Called when the visibility of the view, taking its ancestors and window into account, changes. When it becomes visible the resolution needed by the displayed region is requested again, since detail is dropped when the system asks to free memory while in background.
Resets matrix containing changes on image (scale and translation) and forces view redraw.
Sets bitmap of this view using provided drawable.
Sets the image to display from a file, decoded by regions.
Sets the image to display from a raster drawable resource, decoded by regions.
Sets the source of the image to display, which is decoded by regions at the resolution required by the display transformation. Any previous bitmap is recycled and any previous source is closed. The provided source is owned by this view from now on: it is closed when it is replaced by another image or source, and it must not be closed by the caller. Setting the source that is already set does nothing.
Sets the image to display from a content URI, decoded by regions.