Show / Hide Table of Contents

    Class Image

    Definition

    Namespace:
    ElmSharp
    Assembly:
    ElmSharp.dll
    API Level:
    preview

    The Image is a widget that allows one to load and display an image file on it, be it from a disk file or from a memory region. Inherits Widget.

    public class Image : Widget, IAccessibleObject
    Inheritance
    Object
    EvasObject
    AccessibleObject
    Widget
    Image
    Derived
    Icon
    Icon
    Implements
    IAccessibleObject

    Constructors

    View Source

    Image(EvasObject)

    Creates and initializes a new instance of the Image class.

    Declaration
    public Image(EvasObject parent)
    Parameters
    Type Name Description
    EvasObject parent

    The parent is a given container, which will be attached by the image as a child. It's EvasObject type.

    API Level: preview

    Properties

    View Source

    BackgroundColor

    Sets the background color.

    Declaration
    public override Color BackgroundColor { set; }
    Property Value
    Type Description
    Color
    Overrides
    Widget.BackgroundColor
    API Level: preview
    View Source

    BorderCenterFillMode

    Sets or gets if the center part of the given image object (not the border) should be drawn.

    Declaration
    public ImageBorderFillMode BorderCenterFillMode { get; set; }
    Property Value
    Type Description
    ImageBorderFillMode
    Remarks

    When rendering, the image may be scaled to fit the size of the image object. This function sets if the center part of the scaled image is to be drawn or left completely blank, or forced to be solid. Very useful for frames and decorations.

    API Level: preview
    View Source

    CanFillOutside

    Sets or gets whether the image fills the entire object area, when keeping the aspect ratio.

    Declaration
    public bool CanFillOutside { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    CanScaleDown

    Sets or gets whether the object is down resizable.

    Declaration
    public bool CanScaleDown { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    CanScaleUp

    Sets or gets whether the object is up resizable.

    Declaration
    public bool CanScaleUp { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    Color

    Sets or gets the image color.

    Declaration
    public override Color Color { get; set; }
    Property Value
    Type Description
    Color
    Overrides
    EvasObject.Color
    API Level: preview
    View Source

    File

    Gets the file that is used as an image.

    Declaration
    public string File { get; }
    Property Value
    Type Description
    String
    API Level: preview
    View Source

    ImageObject

    Gets the inlined image object of the image widget. This property allows one to get the underlying EvasObject of type Image from this elementary widget. It can be useful to do things like save the image to a file, etc.

    Declaration
    public EvasImage ImageObject { get; }
    Property Value
    Type Description
    EvasImage
    Remarks

    Be careful not to manipulate it, as it is under the control of the widget.

    API Level: preview
    View Source

    IsAnimated

    Sets or gets whether an image object (which supports animation) is to animate itself.

    Declaration
    public bool IsAnimated { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    IsAnimatedAvailable

    Gets whether an image object supports animation.

    Declaration
    public bool IsAnimatedAvailable { get; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    IsAnimationPlaying

    Sets or gets whether an image object is under animation.

    Declaration
    public bool IsAnimationPlaying { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    An image object, even if it supports animation, will be displayed by default without animation. To actually start playing any image object's animation, IsAnimated should be TRUE before setting this property true.

    API Level: preview
    View Source

    IsEditable

    Sets or gets whether the image is 'editable'.

    Declaration
    public bool IsEditable { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    IsFixedAspect

    Sets or gets whether the original aspect ratio of the image should be kept on resize.

    Declaration
    public bool IsFixedAspect { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    IsOpaque

    Sets or gets whether the alpha channel data is being used on the given image object.

    Declaration
    public bool IsOpaque { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    IsScaling

    Sets or gets whether scaling is disabled on the object.

    Declaration
    public bool IsScaling { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    IsSmooth

    Sets or gets the smooth effect for an image.

    Declaration
    public bool IsSmooth { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    ObjectSize

    Gets the current size of the image.

    Declaration
    public Size ObjectSize { get; }
    Property Value
    Type Description
    Size
    API Level: preview
    View Source

    Orientation

    Sets or gets the image orientation.

    Declaration
    public ImageOrientation Orientation { get; set; }
    Property Value
    Type Description
    ImageOrientation
    API Level: preview
    View Source

    PrescaleSize

    Sets or gets the prescale size for the image.

    Declaration
    public int PrescaleSize { get; set; }
    Property Value
    Type Description
    Int32
    API Level: preview

    Methods

    View Source

    CreateHandle(EvasObject)

    Sets the content at a part of a given container widget.

    Declaration
    protected override IntPtr CreateHandle(EvasObject parent)
    Parameters
    Type Name Description
    EvasObject parent

    The parent is a given container, which will be attached by the image as a child. It's EvasObject type.

    Returns
    Type Description
    IntPtr

    The new object, otherwise null if it cannot be created.

    Overrides
    EvasObject.CreateHandle(EvasObject)
    API Level: preview
    View Source

    GetPartColor(String)

    Gets the color of the Color class for a given widget.

    Declaration
    public override Color GetPartColor(string part)
    Parameters
    Type Name Description
    String part

    The name of the Color class.

    Returns
    Type Description
    Color

    The color object.

    Overrides
    Widget.GetPartColor(String)
    API Level: preview
    View Source

    Load(Byte*, Int64)

    This method will be removed. Use Load(Stream stream) instead.

    Sets a location in the memory to be used as an image object's source bitmap.

    Declaration
    [Obsolete("This method will be removed. Use Load(Stream stream) instead.")]
    public bool Load(byte *img, long size)
    Parameters
    Type Name Description
    Byte* img

    The binary data that is used as an image source.

    Int64 size

    The size of the binary data blob img.

    Returns
    Type Description
    Boolean

    (true = success, false = error)

    Remarks

    This function is handy when the contents of an image file are mapped into the memory, for example, the format string should be something like "png", "jpg", "tga", "tiff", "bmp" etc, when provided (null, on the contrary). This improves the loader performance as it tries the "correct" loader first, before trying a range of other possible loaders until one succeeds.

    API Level: preview
    View Source

    Load(Stream)

    Sets the stream that is used as the image's source.

    Declaration
    public bool Load(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream that is used as an image source.

    Returns
    Type Description
    Boolean

    (true = success, false = error)

    API Level: preview
    View Source

    Load(String)

    Sets the file that is used as the image's source.

    Declaration
    public bool Load(string file)
    Parameters
    Type Name Description
    String file

    The path to the file that is used as an image source.

    Returns
    Type Description
    Boolean

    (true = success, false = error)

    API Level: preview
    View Source

    Load(Uri)

    Sets the URI that is used as the image's source.

    Declaration
    public bool Load(Uri uri)
    Parameters
    Type Name Description
    Uri uri

    The URI to the file that is used as an image source.

    Returns
    Type Description
    Boolean

    (true = success, false = error)

    API Level: preview
    View Source

    LoadAsync(Stream, CancellationToken)

    Sets the stream that is used as the image's source with async.

    Declaration
    public Task<bool> LoadAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Stream stream

    The stream that is used as an image source.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Boolean>

    (true = success, false = error)

    API Level: preview
    View Source

    LoadAsync(String, CancellationToken)

    Sets the file that is used as the image's source with async.

    Declaration
    public Task<bool> LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    String file

    The path to the file that is used as an image source.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Boolean>

    (true = success, false = error)

    API Level: preview
    View Source

    LoadAsync(Uri, CancellationToken)

    Sets the URI that is used as the image's source with async.

    Declaration
    public Task<bool> LoadAsync(Uri uri, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Uri uri

    The URI to the file that is used as an image source.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Boolean>

    (true = success, false = error)

    API Level: preview
    View Source

    SetBorder(Int32, Int32, Int32, Int32)

    Sets the dimensions for an image object's border, a region which is not scaled together with its center ever.

    Declaration
    public void SetBorder(int left, int right, int top, int bottom)
    Parameters
    Type Name Description
    Int32 left

    The border's left width.

    Int32 right

    The border's right width.

    Int32 top

    The border's top width.

    Int32 bottom

    The border's bottom width.

    API Level: preview
    View Source

    SetPartColor(String, Color)

    Sets the color of the Color class for a given widget.

    Declaration
    public override void SetPartColor(string part, Color color)
    Parameters
    Type Name Description
    String part

    The name of the Color class.

    Color color

    The struct of the Color class.

    Overrides
    Widget.SetPartColor(String, Color)
    API Level: preview

    Events

    View Source

    Clicked

    Clicked will be triggered when the image is clicked.

    Declaration
    public event EventHandler Clicked
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    LoadingCompleted

    LoadingCompleted will be triggered when the image is loaded completely.

    Declaration
    public event EventHandler LoadingCompleted
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    LoadingFailed

    Clicked will be triggered when the image fails to load.

    Declaration
    public event EventHandler LoadingFailed
    Event Type
    Type Description
    EventHandler
    API Level: preview

    Implements

    IAccessibleObject

    Extension Methods

    RotaryEventExtensions.AddRotaryEventHandler(EvasObject, RotaryEventHandler)
    RotaryEventExtensions.RemoveRotaryEventHandler(EvasObject, RotaryEventHandler)
    RotaryEventExtensions.Activate(EvasObject)
    RotaryEventExtensions.Deactivate(EvasObject)
    • View Source
    Back to top Copyright © 2016-2020 Samsung
    Generated by DocFX