Android Programming Press on the image to return to the main documentation page.

BetterImageView

Written by Fr\u00e9d\u00e9ric Leneuf-Magaud

List of types:

BetterImageView

BetterImageView


This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Touch(Action As Int, X As Int, Y As Int)
Click
LongClick

Members:


  AlterColors (Source As BitmapWrapper, Hue As Int, Saturation As Float) As android.graphics.Bitmap

  ApplyColorFilter (Source As BitmapWrapper, Multiply As Int, Add As Int) As android.graphics.Bitmap

  Background As android.graphics.drawable.Drawable

  BackgroundBitmap As android.graphics.Bitmap

  Bitmap As android.graphics.Bitmap

  BringToFront

  ChangeAlpha (Alpha As Int)

  ChangeBackgroundAlpha (Alpha As Int)

  DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)

  Drawable As android.graphics.drawable.Drawable

  Enabled As Boolean

  Gravity As Int

  Height As Int

  Initialize (EventPrefix As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  LoadNinePatchDrawable (Name As String) As android.graphics.drawable.Drawable

  LoadScaledBitmap (Dir As String, FileName As String, NewWidth As Int, NewHeight As Int, Filter As Boolean) As android.graphics.Bitmap

  ReduceColors (srcBmp As BitmapWrapper) As android.graphics.Bitmap

  RemoveView

  RequestFocus As Boolean

  ScaleType As android.widget.ImageView.ScaleType

  SCALETYPE_CENTER As android.widget.ImageView.ScaleType

  SCALETYPE_CENTER_CROP As android.widget.ImageView.ScaleType

  SCALETYPE_CENTER_INSIDE As android.widget.ImageView.ScaleType

  SCALETYPE_FIT_CENTER As android.widget.ImageView.ScaleType

  SCALETYPE_FIT_END As android.widget.ImageView.ScaleType

  SCALETYPE_FIT_START As android.widget.ImageView.ScaleType

  SCALETYPE_FIT_XY As android.widget.ImageView.ScaleType

  SendToBack

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

AlterColors (Source As BitmapWrapper, Hue As Int, Saturation As Float) As android.graphics.Bitmap
Changes the hue and the saturation of the given bitmap.
Hue: from 0 to 360. 0 or 360 = no change.
Saturation: 0 = gray-scale, 1 = no change.
ApplyColorFilter (Source As BitmapWrapper, Multiply As Int, Add As Int) As android.graphics.Bitmap
Applies a color filter to the specified bitmap that multiplies the RGB channels by one color, and then adds a second color, pinning the result for each component to [0..255].
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
Returns Null if there is no image.
BackgroundBitmap As android.graphics.Bitmap
Gets or sets the background bitmap.
Returns Null if the image is not a bitmap.
Bitmap As android.graphics.Bitmap
Gets or sets the foreground bitmap.
Returns Null if the image is not a bitmap.
BringToFront
Changes the Z order of this view and brings it to the front.
ChangeAlpha (Alpha As Int)
Changes the alpha value of the foreground image.
Alpha an integer between 0 (fully transparent) and 255 (fully opaque).
ChangeBackgroundAlpha (Alpha As Int)
Changes the alpha value of the background image.
Alpha an integer between 0 (fully transparent) and 255 (fully opaque).
DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
Drawable As android.graphics.drawable.Drawable
Gets or sets the foreground drawable.
Returns Null if there is no image.
Enabled As Boolean
Gets or sets whether this view is enabled (True) or disabled (False).
Gravity As Int
Gets or sets the gravity of the background image.
Only bitmaps are affected by gravity.
Height As Int
Gets or sets the view's height.
Initialize (EventPrefix As String)
Initializes the BetterImageView.
EventPrefix prefix of events.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left.
LoadNinePatchDrawable (Name As String) As android.graphics.drawable.Drawable
Gets a 9-patch drawable from the application resources.
LoadScaledBitmap (Dir As String, FileName As String, NewWidth As Int, NewHeight As Int, Filter As Boolean) As android.graphics.Bitmap
Loads and rescales a bitmap.
Throws an exception if there's not enough memory to load the specified file.
NewWidth: the new bitmap's desired width or -1 to keep the original width.
NewHeight: the new bitmap's desired height or -1 to keep the original height.
Filter: if True, improves the sampling quality.
ReduceColors (srcBmp As BitmapWrapper) As android.graphics.Bitmap
Converts a bitmap from the format ARGB_8888 to the format RGB_565 to save memory.
This function removes the alpha channel and therefore the transparent areas become opaque.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
ScaleType As android.widget.ImageView.ScaleType
Gets or sets how the foreground image should be resized or moved to match the size of this BetterImageView.
The value is one of the SCALETYPE constants.
SCALETYPE_CENTER As android.widget.ImageView.ScaleType
SCALETYPE_CENTER_CROP As android.widget.ImageView.ScaleType
SCALETYPE_CENTER_INSIDE As android.widget.ImageView.ScaleType
SCALETYPE_FIT_CENTER As android.widget.ImageView.ScaleType
SCALETYPE_FIT_END As android.widget.ImageView.ScaleType
SCALETYPE_FIT_START As android.widget.ImageView.ScaleType
SCALETYPE_FIT_XY As android.widget.ImageView.ScaleType
SendToBack
Changes the Z order of this view and sends it to the back.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top.
Visible As Boolean
Width As Int
Gets or sets the view's width.
Top