Class ImageView

    Definition

    Namespace:
    Tizen.NUI.BaseComponents
    Assembly:
    Tizen.NUI.dll

    ImageView is a class for displaying an image resource.
    An instance of ImageView can be created using a URL or an image instance.

    public class ImageView : View, INotifyPropertyChanged, IDisposable
    Inheritance
    object
    BindableObject
    Tizen.NUI.Binding.Element
    BaseHandle
    Animatable
    Container
    View
    ImageView
    Derived
    LottieAnimationView
    LottieAnimationView
    Implements
    System.ComponentModel.INotifyPropertyChanged
    System.IDisposable

    Constructors

    View Source

    ImageView()

    Creates an initialized ImageView.

    Declaration
    public ImageView()
    View Source

    ImageView(string)

    Creates an initialized ImageView from a URL to an image resource.
    If the string is empty, ImageView will not display anything.

    Declaration
    public ImageView(string url)
    Parameters
    Type Name Description
    string url

    The URL of the image resource to display.

    Properties

    View Source

    AdjustViewSize

    Gets or sets the mode to adjust view size to preserve the aspect ratio of the image resource.

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

    This is false by default. If this is set to be true, then the width or height value, which is not set by user explicitly, can be changed automatically to preserve the aspect ratio of the image resource. AdjustViewSize works only if ImageView is added to a View having Layout. e.g. If the image resource size is (100, 100), then the ImageView requests size (100, 100) to its parent layout by default. If the ImageView's HeightSpecification is 50 and AdjustViewSize is true, then the ImageView requests size (50, 50) instead of (100, 50).

    View Source

    Border

    The border of the image in the order: left, right, bottom, top.
    If set, ImageMap will be ignored.
    For N-Patch images only.
    Optional.

    Declaration
    public Rectangle Border { get; set; }
    Property Value
    Type Description
    Rectangle
    Remarks

    The property cascade chaining set is possible. For example, this (imageView.Border.X = 1;) is possible.

    View Source

    BorderOnly

    Gets or sets whether to draw the borders only (if true).
    If not specified, the default is false.
    For N-Patch images only.
    Optional.

    Declaration
    public bool BorderOnly { get; set; }
    Property Value
    Type Description
    bool
    View Source

    CropToMask

    Whether to crop image to mask or scale mask to fit image.

    Declaration
    public bool CropToMask { get; set; }
    Property Value
    Type Description
    bool
    View Source

    Image

    ImageView Image, type PropertyMap: string if it is a URL, map otherwise.

    Declaration
    public PropertyMap Image { get; set; }
    Property Value
    Type Description
    PropertyMap
    Remarks

    This PropertyMap use a ImageVisualProperty.
    See ImageVisualProperty for a detailed description.
    you can also use Visual.Property.
    See Visual.Property for a detailed description.

    Examples

    The following example demonstrates how to use the Image property.

    PropertyMap map = new PropertyMap();
    map.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
    map.Insert(ImageVisualProperty.AlphaMaskURL, new PropertyValue(url));
    map.Insert(ImageVisualProperty.FittingMode, new PropertyValue((int)FittingModeType.ScaleToFill);
    imageview.Image = map;
    View Source

    LoadingStatus

    Gets the loading state of the visual resource.

    Declaration
    public ImageView.LoadingStatusType LoadingStatus { get; }
    Property Value
    Type Description
    ImageView.LoadingStatusType
    View Source

    OrientationCorrection

    Gets or sets whether to automatically correct the orientation of an image.

    Declaration
    public bool OrientationCorrection { get; set; }
    Property Value
    Type Description
    bool
    View Source

    PixelArea

    ImageView PixelArea, type Vector4 (Animatable property).
    Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].

    Declaration
    public RelativeVector4 PixelArea { get; set; }
    Property Value
    Type Description
    RelativeVector4
    Remarks

    The property cascade chaining set is possible. For example, this (imageView.PixelArea.X = 0.1f;) is possible.

    View Source

    PreMultipliedAlpha

    ImageView PreMultipliedAlpha, type Boolean.
    Image must be initialized.

    Declaration
    public bool PreMultipliedAlpha { get; set; }
    Property Value
    Type Description
    bool
    View Source

    ResourceUrl

    ImageView ResourceUrl, type string. This is one of mandatory property. Even if not set or null set, it sets empty string ("") internally. When it is set as null, it gives empty string ("") to be read.

    Declaration
    public string ResourceUrl { get; set; }
    Property Value
    Type Description
    string
    View Source

    SynchronosLoading

    Gets or sets whether to synchronous loading the resourceurl of image.

    Declaration
    [Obsolete("This has been deprecated since API9 and will be removed in API11. Use SynchronousLoading instead.")]
    public bool SynchronosLoading { get; set; }
    Property Value
    Type Description
    bool
    View Source

    SynchronousLoading

    Gets or sets whether the image of the ResourceUrl property will be loaded synchronously.

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

    Changing this property make this ImageView load image synchronously at the next loading by following operation: Reload(), SetImage(string), and by some properties those cause reloading: ResourceUrl, PreMultipliedAlpha and etc.

    Methods

    View Source

    Dispose(DisposeTypes)

    you can override it to clean-up your own resources.

    Declaration
    protected override void Dispose(DisposeTypes type)
    Parameters
    Type Name Description
    DisposeTypes type

    DisposeTypes

    Overrides
    View.Dispose(DisposeTypes)
    View Source

    IsResourceReady()

    Queries if all resources required by a control are loaded and ready.
    Most resources are only loaded when the control is placed on the stage.
    True if the resources are loaded and ready, false otherwise.

    Declaration
    public bool IsResourceReady()
    Returns
    Type Description
    bool
    View Source

    Pause()

    Pauses the animated GIF.

    Declaration
    public void Pause()
    View Source

    Play()

    Plays the animated GIF. This is also the default playback mode.

    Declaration
    public void Play()
    View Source

    Reload()

    Forcefully reloads the image. All the visuals using this image will reload to the latest image.

    Declaration
    public void Reload()
    View Source

    SetImage(string)

    Sets this ImageView from the given URL.
    If the URL is empty, ImageView will not display anything.

    Declaration
    public void SetImage(string url)
    Parameters
    Type Name Description
    string url

    The URL to the image resource to display.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when url is null.

    View Source

    Stop()

    Stops the animated GIF.

    Declaration
    public void Stop()

    Events

    View Source

    ResourceReady

    An event for ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
    This signal is emitted after all resources required by a control are loaded and ready.
    Most resources are only loaded when the control is placed on the stage.

    Declaration
    public event EventHandler<ImageView.ResourceReadyEventArgs> ResourceReady
    Event Type
    Type Description
    System.EventHandler<TEventArgs><ImageView.ResourceReadyEventArgs>

    Implements

    System.ComponentModel.INotifyPropertyChanged
    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX