Class Image
Forms9Patch.Image element
Implements
Inherited Members
Namespace: Forms9Patch
Assembly: Forms9Patch.dll
Syntax
public class Image : SKCanvasView, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, INavigationProxy, IStyleSelectable, IAnimatable, IResourcesProvider, IStyleElement, IFlowDirectionController, IPropertyPropagationController, IVisualController, ITabStopElement, IStylable, IGestureController, IGestureRecognizers, ISKCanvasViewController, IImage, IImageController, IViewController, IVisualElementController, IElementController, IExtendedShape, IBubbleShape, IShape, IElement, IDisposable
Constructors
Image()
Constructor
Declaration
public Image()
Image(Image)
Convenience constructor for Forms9Patch.Image
Declaration
public Image(Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | image |
Image(String, Assembly)
Instantiates a new instance of Image from an MultiResource embedded resource
Declaration
public Image(string embeddedResourceId, Assembly assembly = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | embeddedResourceId | EmbeddedResourceId for image |
| Assembly | assembly | Assembly in which embedded resource is embedded |
Image(Image)
Initializes a new instance of the Image class.
Declaration
public Image(Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | image | Image. |
Image(ImageSource)
Instantiates a new instance of Image from an imageSource
Declaration
public Image(ImageSource imageSource)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageSource | imageSource |
Fields
AntiAliasProperty
backing store for AntiAlias property
Declaration
public static readonly BindableProperty AntiAliasProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
BackgroundColorProperty
backing store for BackgroundColor property
Declaration
public static readonly BindableProperty BackgroundColorProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
BorderColorProperty
The boarder color property.
Declaration
public static readonly BindableProperty BorderColorProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
BorderRadiusProperty
The boarder radius property.
Declaration
public static readonly BindableProperty BorderRadiusProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
BorderWidthProperty
The boarder width property.
Declaration
public static readonly BindableProperty BorderWidthProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
CapInsetsProperty
Backing store for the CapsInset bindable property.
Declaration
public static readonly BindableProperty CapInsetsProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty | The end-cap insets (double or int) |
Remarks
End caps specify the portion of an image that should not be resized when an image is stretched. This technique is used to implement buttons and other resizable image-based interface elements. When a button with end caps is resized, the resizing occurs only in the middle of the button, in the region between the end caps. The end caps themselves keep their original size and appearance.
ContentPaddingProperty
Backing store for the ContentPadding bindable property.
Declaration
public static readonly BindableProperty ContentPaddingProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
ElementShapeProperty
Backing store for the ElementShape property
Declaration
public static readonly BindableProperty ElementShapeProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
ExtendedElementSeparatorWidthProperty
Backing store key for INTERNAL ExtendedElementSeparatorWidth property
Declaration
public static readonly BindableProperty ExtendedElementSeparatorWidthProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
ExtendedElementShapeOrientationProperty
Backing store for the extended element shape orientation property.
Declaration
public static readonly BindableProperty ExtendedElementShapeOrientationProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
ExtendedElementShapeProperty
backing store for ExtendedElementShape property
Declaration
public static readonly BindableProperty ExtendedElementShapeProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
FailActionProperty
Backing store for Image FailAction property
Declaration
public static readonly BindableProperty FailActionProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
FillProperty
Backing store for the Fill bindable property.
Declaration
public static readonly BindableProperty FillProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
HasShadowProperty
Backing store for HasShadow property
Declaration
public static readonly BindableProperty HasShadowProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
IsLoadingProperty
backing store for IsLoading property
Declaration
public static readonly BindableProperty IsLoadingProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
OutlineColorProperty
Backing store for the outline color property.
Declaration
public static readonly BindableProperty OutlineColorProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
OutlineRadiusProperty
Backing store for the outline radius property.
Declaration
public static readonly BindableProperty OutlineRadiusProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
OutlineWidthProperty
Backing store for the outline width property.
Declaration
public static readonly BindableProperty OutlineWidthProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
PointerAxialPositionProperty
Backing store for pointer axial position property.
Declaration
public static readonly BindableProperty PointerAxialPositionProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
PointerCornerRadiusProperty
The pointer corner radius property.
Declaration
public static readonly BindableProperty PointerCornerRadiusProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
PointerDirectionProperty
Backing store for pointer direction property.
Declaration
public static readonly BindableProperty PointerDirectionProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
PointerLengthProperty
Backing store for pointer length property.
Declaration
public static readonly BindableProperty PointerLengthProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
PointerTipRadiusProperty
Backing store for pointer tip radius property.
Declaration
public static readonly BindableProperty PointerTipRadiusProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
ShadowInvertedProperty
backing store for ShadowInverted property
Declaration
public static readonly BindableProperty ShadowInvertedProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
SourceProperty
backing store for Source property
Declaration
public static readonly BindableProperty SourceProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
TintColorProperty
The tint property.
Declaration
public static readonly BindableProperty TintColorProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
Properties
AntiAlias
Gets/Sets the AntiAlias property
Declaration
public bool AntiAlias { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
BackgroundColor
Gets/Sets the BackgroundColor property
Declaration
public Color BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
BorderColor
Gets or sets the color of the boarder.
Declaration
public Color BorderColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color | The color of the boarder. |
BorderRadius
Gets or sets the boarder radius.
Declaration
public float BorderRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| Single | The boarder radius. |
BorderWidth
Gets or sets the width of the boarder.
Declaration
public float BorderWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| Single | The width of the boarder. |
CapInsets
Gets or sets the end-cap insets. This is a bindable property.
Declaration
public Thickness CapInsets { get; set; }
Property Value
| Type | Description |
|---|---|
| Thickness | The end-cap insets. |
ContentPadding
Gets content padding if Source is NinePatch image.
Declaration
public Thickness ContentPadding { get; }
Property Value
| Type | Description |
|---|---|
| Thickness | The content padding. |
ElementShape
Gets/sets the geometry of the element
Declaration
public ElementShape ElementShape { get; set; }
Property Value
| Type | Description |
|---|---|
| ElementShape |
FailAction
controls value of Image FailAction property
Declaration
public FailAction FailAction { get; set; }
Property Value
| Type | Description |
|---|---|
| FailAction |
Fill
Fill behavior for nonscalable (not NinePatch or CapInsets not set) image.
Declaration
public Fill Fill { get; set; }
Property Value
| Type | Description |
|---|---|
| Fill | The fill method (AspectFill, AspectFit, Fill, Tile) |
HasShadow
Get/sets if the shape (if any) behind the image has a shadow
Declaration
public bool HasShadow { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
InstanceId
Returns index instance ID for this class (starts at 0)
Declaration
public int InstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
IsLoading
Gets/Sets the IsLoading property
Declaration
public bool IsLoading { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
OutlineColor
Gets or sets the color of the outline.
Declaration
public Color OutlineColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color | The color of the outline. |
OutlineRadius
Gets or sets the outline radius.
Declaration
public float OutlineRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| Single | The outline radius. |
OutlineWidth
Gets or sets the width of the outline.
Declaration
public float OutlineWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| Single | The width of the outline. |
ShadowInverted
Gets/Sets the ShadowInverted property
Declaration
public bool ShadowInverted { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Source
Gets/Sets the Source property
Declaration
public ImageSource Source { get; set; }
Property Value
| Type | Description |
|---|---|
| ImageSource |
SourceImageHeight
Height of source Image
Declaration
public double SourceImageHeight { get; }
Property Value
| Type | Description |
|---|---|
| Double |
SourceImageSize
Size of source image
Declaration
public Size SourceImageSize { get; }
Property Value
| Type | Description |
|---|---|
| Size |
SourceImageWidth
Width of source image
Declaration
public double SourceImageWidth { get; }
Property Value
| Type | Description |
|---|---|
| Double |
TintColor
Gets or sets the image's tint.
Declaration
public Color TintColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color | The tint. Default is not to tint the image |
Methods
ClearDownloadCache(String)
Clears the cache of Forms9Patch images sourced using Xamarin.Forms.ImageSource.FromUri
Declaration
public static void ClearDownloadCache(string uri = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | uri | The URI of the image. If null, all cached images are cleared. |
ClearEmbeddedResourceCache(String, Assembly)
Apps run faster when Embedded Resources image don't have to be extracted EVERY SINGLE TIME. This clears the cache of these images.
Declaration
public static void ClearEmbeddedResourceCache(string resourceId = null, Assembly assembly = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | resourceId | |
| Assembly | assembly |
Dispose()
Dispose the image
Declaration
public void Dispose()
Dispose(Boolean)
Disposed the image
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | disposing |
GetSizeRequest(Double, Double)
Internal use only
Declaration
[Obsolete("Ugh")]
public override SizeRequest GetSizeRequest(double widthConstraint, double heightConstraint)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | widthConstraint | |
| Double | heightConstraint |
Returns
| Type | Description |
|---|---|
| SizeRequest |
Overrides
OnBindingContextChanged()
Called when the binding contex has changed.
Declaration
protected override void OnBindingContextChanged()
Overrides
OnPaintSurface(SKPaintSurfaceEventArgs)
Internal use only
Declaration
protected override void OnPaintSurface(SKPaintSurfaceEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| SKPaintSurfaceEventArgs | e |
Overrides
OnPropertyChanged(String)
Called when a property has changed
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | propertyName |
Overrides
Operators
Implicit(String to Image)
Converts string (embedded resource id) into a Forms9Patch.Image
Declaration
public static implicit operator Image(string embeddedResourceId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | embeddedResourceId |
Returns
| Type | Description |
|---|---|
| Image |
Implicit(Image to Image)
Converts Xamarin.Forms.Image to Forms9Patch.Image
Declaration
public static implicit operator Image(Image xamarinFormsImage)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | xamarinFormsImage |
Returns
| Type | Description |
|---|---|
| Image |
Explicit Interface Implementations
IExtendedShape.ExtendedElementSeparatorWidth
Declaration
float IExtendedShape.ExtendedElementSeparatorWidth { get; set; }
Returns
| Type | Description |
|---|---|
| Single |
IExtendedShape.ExtendedElementShape
Gets/Sets the ExtendedElementShape property
Declaration
ExtendedElementShape IExtendedShape.ExtendedElementShape { get; set; }
Returns
| Type | Description |
|---|---|
| ExtendedElementShape |
IExtendedShape.ExtendedElementShapeOrientation
Gets or sets the orientation of the shape if it's an extended element shape
Declaration
StackOrientation IExtendedShape.ExtendedElementShapeOrientation { get; set; }
Returns
| Type | Description |
|---|---|
| StackOrientation | The forms9 patch. IS hape. extended element shape orientation. |
IImageController.GetLoadAsAnimation()
Declaration
bool IImageController.GetLoadAsAnimation()
Returns
| Type | Description |
|---|---|
| Boolean |
IImageController.SetIsLoading(Boolean)
Declaration
void IImageController.SetIsLoading(bool isLoading)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | isLoading |