ActionComponents  04.05.00
Customizable UI and time-saving tools for Android development with Xamarin and Visual Studio.
ActionComponents.ACImageView Class Reference

The ActionComponents.ACImageView is a custom ImageView with built-in helper routines to automatically handle user interaction such as dragging (with optional constraints on the x and y axis), events such as Touched, Moved and Released and image loading, scaling and rotation. The ActionComponents.ACImageView includes a DisposeImage method to release the memory being held by an image Bitmap. Memory will automatically be purged before loading a new image into this ActionComponents.ACImageView. More...

Inheritance diagram for ActionComponents.ACImageView:
Collaboration diagram for ActionComponents.ACImageView:

Public Member Functions

 ACImageView (Context context)
 Initializes a new instance of the ActionComponents.ACImageView class. More...
 
 ACImageView (Context context, IAttributeSet attr)
 Initializes a new instance of the ActionComponents.ACImageView class. More...
 
 ACImageView (IntPtr javaReference, JniHandleOwnership transfer)
 Initializes a new instance of the ActionComponents.ACImageView class. More...
 
 ACImageView (Context context, IAttributeSet attr, int defStyle)
 Initializes a new instance of the ActionComponents.ACImageView class. More...
 
void FromBitmap (Bitmap bitmap)
 Loads the image displayed in this ActionComponents.ACImageView from the given Bitmap More...
 
void FromFile (string filename)
 Loads the image displayed in this ActionComponents.ACImageView from the given filename More...
 
void FromFile (string filename, int width, int height)
 Loads the image displayed in this ActionComponents.ACImageView from the given filename resampling the image to the given height/width More...
 
void FromResource (Android.Content.Res.Resources resources, int resourceID)
 Loads the image being displayed by this ActionComponents.ACImageView from the given resources and resource ID More...
 
void FromResource (Android.Content.Res.Resources resources, int resourceID, int width, int height)
 Loads the image being displayed by this ActionComponents.ACImageView from the given resources and resource ID resampling the image to the given height/width More...
 
void DisposeImage ()
 Forces this ActionComponents.ACImageView to release all of the memory being held by the Bitmap image it is displaying More...
 
void MoveToPoint (int x, int y)
 Moves this ActionComponents.ACImageView to the given point and honors any ActionComponents.ACViewDragConstraints applied to the X or Y axis More...
 
void MoveToPoint (Point point)
 Moves this ActionComponents.ACImageView to the given point and honors any ActionComponents.ACViewDragConstraints applied to the X or Y axis More...
 
void Resize (int width, int height)
 Resize this ActionComponents.ACImageView to the specified width and height. More...
 
void RotateTo (float degrees)
 Rotates the image being controlled by this ActionComponents.ACImageView to the given degrees More...
 
bool PointInside (int x, int y)
 Test to see if the given x and y coordinates are inside this ActionComponents.ACImageView More...
 
bool PointInside (Point pt)
 Test to see if the given point is inside this ActionComponents.ACImageView More...
 
override bool OnTouchEvent (MotionEvent e)
 Raises the touch event event. More...
 
delegate void ACImageViewTouchedDelegate (ACImageView view)
 Occurs when this ActionComponents.ACImageView is touched More...
 
delegate void ACImageViewMovedDelegate (ACImageView view)
 Occurs when this ActionComponents.ACImageView is moved More...
 
delegate void ACImageViewReleasedDelegate (ACImageView view)
 Occurs when this ActionComponents.ACImageView is released More...
 

Properties

Object tag [get, set]
 Gets or sets the [OPTIONAL] tag that can be assosciated with this ActionComponents.ACImageView More...
 
bool draggable [get, set]
 Gets or sets a value indicating whether this ActionComponents.ACImageView is draggable. More...
 
bool dragging [get]
 Gets a value indicating whether this ActionComponents.ACImageView is being dragged by the user. More...
 
bool bringToFrontOnTouched [get, set]
 Gets or sets a value indicating whether this ActionComponents.ACImageView is automatically brought to the front when touched. More...
 
ACViewDragConstraint xConstraint [get, set]
 Gets or sets the ActionComponents.ACViewDragConstraint applied to the x axis of this ActionComponents.ACImageView More...
 
ACViewDragConstraint yConstraint [get, set]
 Gets or sets the ActionComponents.ACViewDragConstraint applied to the y axis of this ActionComponents.ACImageView More...
 
int LeftMargin [get, set]
 Gets or sets the left margin. More...
 
int TopMargin [get, set]
 Gets or sets the top margin. More...
 
int RightMargin [get, set]
 Gets or sets the right margin. More...
 
int BottomMargin [get, set]
 Gets or sets the bottom margin. More...
 
int LayoutWidth [get, set]
 Gets or sets the width of the layout. More...
 
int LayoutHeight [get, set]
 Gets or sets the height of the layout. More...
 

Events

ACImageViewTouchedDelegate Touched
 
ACImageViewMovedDelegate Moved
 
ACImageViewReleasedDelegate Released
 

Detailed Description

The ActionComponents.ACImageView is a custom ImageView with built-in helper routines to automatically handle user interaction such as dragging (with optional constraints on the x and y axis), events such as Touched, Moved and Released and image loading, scaling and rotation. The ActionComponents.ACImageView includes a DisposeImage method to release the memory being held by an image Bitmap. Memory will automatically be purged before loading a new image into this ActionComponents.ACImageView.

Notice!: The ActionComponents.ACImageView works best hosted inside of a RelativeLayout. Available in ActionPack Business or Enterprise only.

Constructor & Destructor Documentation

ActionComponents.ACImageView.ACImageView ( Context  context)

Initializes a new instance of the ActionComponents.ACImageView class.

Parameters
contextContext.
ActionComponents.ACImageView.ACImageView ( Context  context,
IAttributeSet  attr 
)

Initializes a new instance of the ActionComponents.ACImageView class.

Parameters
contextContext.
attrAttr.
ActionComponents.ACImageView.ACImageView ( IntPtr  javaReference,
JniHandleOwnership  transfer 
)

Initializes a new instance of the ActionComponents.ACImageView class.

Parameters
javaReferenceJava reference.
transferTransfer.
ActionComponents.ACImageView.ACImageView ( Context  context,
IAttributeSet  attr,
int  defStyle 
)

Initializes a new instance of the ActionComponents.ACImageView class.

Parameters
contextContext.
attrAttr.
defStyleDef style.

Member Function Documentation

delegate void ActionComponents.ACImageView.ACImageViewMovedDelegate ( ACImageView  view)

Occurs when this ActionComponents.ACImageView is moved

delegate void ActionComponents.ACImageView.ACImageViewReleasedDelegate ( ACImageView  view)

Occurs when this ActionComponents.ACImageView is released

delegate void ActionComponents.ACImageView.ACImageViewTouchedDelegate ( ACImageView  view)

Occurs when this ActionComponents.ACImageView is touched

Here is the caller graph for this function:

void ActionComponents.ACImageView.DisposeImage ( )

Forces this ActionComponents.ACImageView to release all of the memory being held by the Bitmap image it is displaying

Here is the caller graph for this function:

void ActionComponents.ACImageView.FromBitmap ( Bitmap  bitmap)

Loads the image displayed in this ActionComponents.ACImageView from the given Bitmap

Parameters
bitmapBitmap.

If this ActionComponents.ACImageView already has an image loaded, it will be purged from memory before the new image is loaded

Here is the call graph for this function:

void ActionComponents.ACImageView.FromFile ( string  filename)

Loads the image displayed in this ActionComponents.ACImageView from the given filename

Parameters
filenameFilename.

If this ActionComponents.ACImageView already has an image loaded, it will be purged from memory before the new image is loaded

Here is the call graph for this function:

void ActionComponents.ACImageView.FromFile ( string  filename,
int  width,
int  height 
)

Loads the image displayed in this ActionComponents.ACImageView from the given filename resampling the image to the given height/width

Parameters
filenameFilename.
widthWidth.
heightHeight.

If this ActionComponents.ACImageView already has an image loaded, it will be purged from memory before the new image is loaded

Here is the call graph for this function:

void ActionComponents.ACImageView.FromResource ( Android.Content.Res.Resources  resources,
int  resourceID 
)

Loads the image being displayed by this ActionComponents.ACImageView from the given resources and resource ID

Parameters
resourcesResources.
resourceIDResource ID.

If this ActionComponents.ACImageView already has an image loaded, it will be purged from memory before the new image is loaded

Here is the call graph for this function:

void ActionComponents.ACImageView.FromResource ( Android.Content.Res.Resources  resources,
int  resourceID,
int  width,
int  height 
)

Loads the image being displayed by this ActionComponents.ACImageView from the given resources and resource ID resampling the image to the given height/width

Parameters
resourcesResources.
resourceIDResource ID.
widthWidth.
heightHeight.

If this ActionComponents.ACImageView already has an image loaded, it will be purged from memory before the new image is loaded

Here is the call graph for this function:

void ActionComponents.ACImageView.MoveToPoint ( int  x,
int  y 
)

Moves this ActionComponents.ACImageView to the given point and honors any ActionComponents.ACViewDragConstraints applied to the X or Y axis

Parameters
xThe x coordinate.
yThe y coordinate.

Here is the caller graph for this function:

void ActionComponents.ACImageView.MoveToPoint ( Point  point)

Moves this ActionComponents.ACImageView to the given point and honors any ActionComponents.ACViewDragConstraints applied to the X or Y axis

Parameters
ptPoint.
override bool ActionComponents.ACImageView.OnTouchEvent ( MotionEvent  e)

Raises the touch event event.

Parameters
eE.

Here is the call graph for this function:

bool ActionComponents.ACImageView.PointInside ( int  x,
int  y 
)

Test to see if the given x and y coordinates are inside this ActionComponents.ACImageView

Returns
true, if inside was pointed, false otherwise.
Parameters
xThe x coordinate.
yThe y coordinate.

Here is the caller graph for this function:

bool ActionComponents.ACImageView.PointInside ( Point  pt)

Test to see if the given point is inside this ActionComponents.ACImageView

Returns
true, if inside was pointed, false otherwise.
Parameters
ptPoint.

Here is the call graph for this function:

void ActionComponents.ACImageView.Resize ( int  width,
int  height 
)

Resize this ActionComponents.ACImageView to the specified width and height.

Parameters
widthWidth.
heightHeight.
void ActionComponents.ACImageView.RotateTo ( float  degrees)

Rotates the image being controlled by this ActionComponents.ACImageView to the given degrees

Parameters
degreesDegrees.

Property Documentation

int ActionComponents.ACImageView.BottomMargin
getset

Gets or sets the bottom margin.

The bottom margin.

bool ActionComponents.ACImageView.bringToFrontOnTouched
getset

Gets or sets a value indicating whether this ActionComponents.ACImageView is automatically brought to the front when touched.

true if bring to front on touched; otherwise, false.

bool ActionComponents.ACImageView.draggable
getset

Gets or sets a value indicating whether this ActionComponents.ACImageView is draggable.

true if is draggable; otherwise, false.

bool ActionComponents.ACImageView.dragging
get

Gets a value indicating whether this ActionComponents.ACImageView is being dragged by the user.

true if dragging; otherwise, false.

int ActionComponents.ACImageView.LayoutHeight
getset

Gets or sets the height of the layout.

The height of the layout.

int ActionComponents.ACImageView.LayoutWidth
getset

Gets or sets the width of the layout.

The width of the layout.

int ActionComponents.ACImageView.LeftMargin
getset

Gets or sets the left margin.

The left margin.

int ActionComponents.ACImageView.RightMargin
getset

Gets or sets the right margin.

The right margin.

Object ActionComponents.ACImageView.tag
getset

Gets or sets the [OPTIONAL] tag that can be assosciated with this ActionComponents.ACImageView

The tag.

int ActionComponents.ACImageView.TopMargin
getset

Gets or sets the top margin.

The top margin.

ACViewDragConstraint ActionComponents.ACImageView.xConstraint
getset

Gets or sets the ActionComponents.ACViewDragConstraint applied to the x axis of this ActionComponents.ACImageView

The x constraint.

ACViewDragConstraint ActionComponents.ACImageView.yConstraint
getset

Gets or sets the ActionComponents.ACViewDragConstraint applied to the y axis of this ActionComponents.ACImageView

The y constraint.

Event Documentation

ACImageViewMovedDelegate ActionComponents.ACImageView.Moved
ACImageViewReleasedDelegate ActionComponents.ACImageView.Released
ACImageViewTouchedDelegate ActionComponents.ACImageView.Touched