Class ImageView

Definition

Namespace:
Tizen.NUI.BaseComponents
Assembly:
Tizen.NUI.dll
API Level:
3

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

C#
Copy
public class ImageView : View, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider
Inheritance
Derived
Implements

Constructors

View Source

ImageView()

Creates an initialized ImageView.

Declaration
C#
Copy
public ImageView()
API Level: 3
View Source

ImageView(Boolean)

Creates an initialized ImageView with setting the status of shown or hidden.

Declaration
C#
Copy
public ImageView(bool shown)
Parameters
Type Name Description
Boolean shown

false : Not displayed (hidden), true : displayed (shown)

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
C#
Copy
public ImageView(string url)
Parameters
Type Name Description
String url

The URL of the image resource to display.

API Level: 3
View Source

ImageView(String, Boolean)

Creates an initialized ImageView from a URL to an image resource with setting shown or hidden.

Declaration
C#
Copy
public ImageView(string url, bool shown)
Parameters
Type Name Description
String url

The URL of the image resource to display.

Boolean shown

false : Not displayed (hidden), true : displayed (shown)

View Source

ImageView(ViewStyle)

Declaration
C#
Copy
public ImageView(ViewStyle viewStyle)
Parameters
Type Name Description
ViewStyle viewStyle

Fields

View Source

AdjustViewSizeProperty

AdjustViewSizeProperty

Declaration
C#
Copy
public static readonly BindableProperty AdjustViewSizeProperty
Field Value
Type Description
BindableProperty
View Source

AlphaMaskURLProperty

AlphaMaskURLProperty

Declaration
C#
Copy
public static readonly BindableProperty AlphaMaskURLProperty
Field Value
Type Description
BindableProperty
View Source

BorderOnlyProperty

Declaration
C#
Copy
public static readonly BindableProperty BorderOnlyProperty
Field Value
Type Description
BindableProperty
View Source

BorderProperty

Declaration
C#
Copy
public static readonly BindableProperty BorderProperty
Field Value
Type Description
BindableProperty
View Source

CropToMaskProperty

CropToMaskProperty

Declaration
C#
Copy
public static readonly BindableProperty CropToMaskProperty
Field Value
Type Description
BindableProperty
View Source

DesiredHeightProperty

DesiredHeightProperty

Declaration
C#
Copy
public static readonly BindableProperty DesiredHeightProperty
Field Value
Type Description
BindableProperty
View Source

DesiredWidthProperty

DesiredWidthProperty

Declaration
C#
Copy
public static readonly BindableProperty DesiredWidthProperty
Field Value
Type Description
BindableProperty
View Source

FastTrackUploadingProperty

FastTrackUploadingProperty

Declaration
C#
Copy
public static readonly BindableProperty FastTrackUploadingProperty
Field Value
Type Description
BindableProperty
View Source

FittingModeProperty

FittingModeProperty

Declaration
C#
Copy
public static readonly BindableProperty FittingModeProperty
Field Value
Type Description
BindableProperty
View Source

ImageColorProperty

ImageColorProperty

Declaration
C#
Copy
public static readonly BindableProperty ImageColorProperty
Field Value
Type Description
BindableProperty
View Source

ImageMapProperty

ImageMapProperty

Declaration
C#
Copy
public static readonly BindableProperty ImageMapProperty
Field Value
Type Description
BindableProperty
View Source

ImageProperty

Declaration
C#
Copy
public static readonly BindableProperty ImageProperty
Field Value
Type Description
BindableProperty
View Source

MaskingModeProperty

MaskingModeProperty

Declaration
C#
Copy
public static readonly BindableProperty MaskingModeProperty
Field Value
Type Description
BindableProperty
View Source

OrientationCorrectionProperty

Declaration
C#
Copy
public static readonly BindableProperty OrientationCorrectionProperty
Field Value
Type Description
BindableProperty
View Source

PixelAreaProperty

Declaration
C#
Copy
public static readonly BindableProperty PixelAreaProperty
Field Value
Type Description
BindableProperty
View Source

PlaceHolderUrlProperty

PlaceHolderUrlProperty

Declaration
C#
Copy
public static readonly BindableProperty PlaceHolderUrlProperty
Field Value
Type Description
BindableProperty
View Source

PreMultipliedAlphaProperty

Declaration
C#
Copy
public static readonly BindableProperty PreMultipliedAlphaProperty
Field Value
Type Description
BindableProperty
View Source

ReleasePolicyProperty

ReleasePolicyProperty

Declaration
C#
Copy
public static readonly BindableProperty ReleasePolicyProperty
Field Value
Type Description
BindableProperty
View Source

ResourceUrlProperty

Declaration
C#
Copy
public static readonly BindableProperty ResourceUrlProperty
Field Value
Type Description
BindableProperty
View Source

SynchronosLoadingProperty

Declaration
C#
Copy
public static readonly BindableProperty SynchronosLoadingProperty
Field Value
Type Description
BindableProperty
View Source

SynchronousLoadingProperty

Declaration
C#
Copy
public static readonly BindableProperty SynchronousLoadingProperty
Field Value
Type Description
BindableProperty
View Source

TransitionEffectProperty

Declaration
C#
Copy
public static readonly BindableProperty TransitionEffectProperty
Field Value
Type Description
BindableProperty
View Source

WrapModeUProperty

WrapModeUProperty

Declaration
C#
Copy
public static readonly BindableProperty WrapModeUProperty
Field Value
Type Description
BindableProperty
View Source

WrapModeVProperty

WrapModeVProperty

Declaration
C#
Copy
public static readonly BindableProperty WrapModeVProperty
Field Value
Type Description
BindableProperty

Properties

View Source

AdjustViewSize

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

Declaration
C#
Copy
public bool AdjustViewSize { get; set; }
Property Value
Type Description
Boolean
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).

API Level: 9
View Source

AlphaMaskURL

Gets or sets the URL of the alpha mask.
Optional.

Declaration
C#
Copy
public string AlphaMaskURL { get; set; }
Property Value
Type Description
String
API Level: 6
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
C#
Copy
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.

API Level: 3
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
C#
Copy
public bool BorderOnly { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

CropToMask

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

Declaration
C#
Copy
public bool CropToMask { get; set; }
Property Value
Type Description
Boolean
API Level: 6
View Source

DesiredHeight

Gets or sets the desired image height.
If not specified, the actual image height is used.
For normal quad images only.
Optional.

Declaration
C#
Copy
public int DesiredHeight { get; set; }
Property Value
Type Description
Int32
API Level: 6
View Source

DesiredWidth

Gets or sets the desired image width.
If not specified, the actual image width is used.
For normal quad images only.
Optional.

Declaration
C#
Copy
public int DesiredWidth { get; set; }
Property Value
Type Description
Int32
API Level: 6
View Source

FastTrackUploading

Gets or sets whether to apply fast track uploading or not.

Declaration
C#
Copy
public bool FastTrackUploading { get; set; }
Property Value
Type Description
Boolean
Remarks

If we use fast track uploading feature, It can upload texture without event-thead dependency. But also,

  • Texture size is invalid until ResourceReady signal comes.
  • Texture cannot be cached (We always try to load new image).
  • Seamless visual change didn't supported.
  • Alpha masking didn't supported. If you try, It will load as normal case.
  • Synchronous loading didn't supported. If you try, It will load as normal case.
  • Reload action didn't supported. If you try, It will load as normal case.
  • Atlas loading didn't supported. If you try, It will load as normal case.
  • Custom shader didn't supported. If you try, It will load as normal case.
View Source

FittingMode

Gets or sets fitting options used when resizing images to fit.
If not supplied, the default is FittingModeType.Fill.
For normal quad images only.
Optional.

Declaration
C#
Copy
public FittingModeType FittingMode { get; set; }
Property Value
Type Description
FittingModeType
API Level: 6
View Source

Image

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

Declaration
C#
Copy
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.

Copy
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;
API Level: 4
View Source

ImageColor

The mixed color value for the image.

Declaration
C#
Copy
public Color ImageColor { get; set; }
Property Value
Type Description
Color
Remarks

The property cascade chaining set is not recommended.

Examples

This way is recommended for setting the property

Copy
var imageView = new ImageView(); imageView.ImageColor = new Color(0.5f, 0.1f, 0.0f, 1.0f);

This way to set the property is prohibited

Copy
imageView.ImageColor.R = 0.5f; //This does not guarantee a proper operation
View Source

ImageMap

This will be deprecated, Use Image instead.
ImageView ImageMap, type PropertyMap: string if it is a URL, map otherwise.

Declaration
C#
Copy
public PropertyMap ImageMap { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

LoadingStatus

Gets the loading state of the visual resource.

Declaration
C#
Copy
public ImageView.LoadingStatusType LoadingStatus { get; }
Property Value
Type Description
ImageView.LoadingStatusType
API Level: 5
View Source

MaskingMode

Gets or sets whether to apply mask on GPU or not.

Declaration
C#
Copy
public ImageView.MaskingModeType MaskingMode { get; set; }
Property Value
Type Description
ImageView.MaskingModeType
View Source

OrientationCorrection

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

Declaration
C#
Copy
public bool OrientationCorrection { get; set; }
Property Value
Type Description
Boolean
API Level: 5
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
C#
Copy
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.

API Level: 3
View Source

PlaceHolderUrl

ImageView PlaceHolderUrl, 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
C#
Copy
public string PlaceHolderUrl { get; set; }
Property Value
Type Description
String
API Level: 11
View Source

PreMultipliedAlpha

ImageView PreMultipliedAlpha, type Boolean.
Image must be initialized.

Declaration
C#
Copy
public bool PreMultipliedAlpha { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

ReleasePolicy

Gets or sets ReleasePolicy for image.
If not supplied, the default is ReleasePolicyType.Detached.

Declaration
C#
Copy
public ReleasePolicyType ReleasePolicy { get; set; }
Property Value
Type Description
ReleasePolicyType
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
C#
Copy
public string ResourceUrl { get; set; }
Property Value
Type Description
String
API Level: 3
View Source

SynchronosLoading

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

Declaration
C#
Copy
public bool SynchronosLoading { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

SynchronousLoading

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

Declaration
C#
Copy
public bool SynchronousLoading { get; set; }
Property Value
Type Description
Boolean
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.

API Level: 9
View Source

TransitionEffect

Gets or sets whether the image use TransitionEffect or not

Declaration
C#
Copy
public bool TransitionEffect { get; set; }
Property Value
Type Description
Boolean
API Level: 11
View Source

WrapModeU

Gets or sets the wrap mode for the u coordinate.
It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.
If not specified, the default is WrapModeType.Default(CLAMP).
For normal quad images only.
Optional.

Declaration
C#
Copy
public WrapModeType WrapModeU { get; set; }
Property Value
Type Description
WrapModeType
API Level: 6
View Source

WrapModeV

Gets or sets the wrap mode for the v coordinate.
It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.
The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.
If not specified, the default is WrapModeType.Default(CLAMP).
For normal quad images only. Optional.

Declaration
C#
Copy
public WrapModeType WrapModeV { get; set; }
Property Value
Type Description
WrapModeType
API Level: 6

Methods

View Source

CheckResourceReady()

Declaration
C#
Copy
protected override bool CheckResourceReady()
Returns
Type Description
Boolean
Overrides
View Source

CreateViewStyle()

Get attributes, it is abstract function and must be override.

Declaration
C#
Copy
protected override ViewStyle CreateViewStyle()
Returns
Type Description
ViewStyle
Overrides
View Source

Dispose(DisposeTypes)

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

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

DisposeTypes

Overrides
API Level: 3
View Source

DownCast(BaseHandle)

Downcasts a handle to imageView handle.

Declaration
C#
Copy
public static ImageView DownCast(BaseHandle handle)
Parameters
Type Name Description
BaseHandle handle
Returns
Type Description
ImageView
API Level: 3
View Source

GetCachedImageVisualProperty(Int32)

Get image visual property from NUI cached image map by key. If there is no matched value, return null.

Declaration
C#
Copy
protected virtual PropertyValue GetCachedImageVisualProperty(int key)
Parameters
Type Name Description
Int32 key
Returns
Type Description
PropertyValue
View Source

GetImageVisualProperty(Int32)

Get image visual property by key. If we found value in local Cached result, return that. Else, get synced native map and return that. If there is no matched value, return null.

Declaration
C#
Copy
protected virtual PropertyValue GetImageVisualProperty(int key)
Parameters
Type Name Description
Int32 key
Returns
Type Description
PropertyValue
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
C#
Copy
public bool IsResourceReady()
Returns
Type Description
Boolean
API Level: 3
View Source

MergeCachedImageVisualProperty(PropertyMap)

Update NUI cached image visual property map by inputed property map.

Declaration
C#
Copy
protected virtual void MergeCachedImageVisualProperty(PropertyMap map)
Parameters
Type Name Description
PropertyMap map
Remarks

For performance issue, we will collect only "cachedImagePropertyKeyList" hold.

View Source

Pause()

Pauses the animated GIF.

Declaration
C#
Copy
public void Pause()
API Level: 5
View Source

Play()

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

Declaration
C#
Copy
public void Play()
API Level: 5
View Source

ReleaseSwigCPtr(Runtime.InteropServices.HandleRef)

Declaration
C#
Copy
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type Name Description
Tizen.System.Runtime.InteropServices.HandleRef swigCPtr
Overrides
View Source

Reload()

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

Declaration
C#
Copy
public void Reload()
API Level: 5
View Source

SetImage(String)

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

Declaration
C#
Copy
public void SetImage(string url)
Parameters
Type Name Description
String url

The URL to the image resource to display.

API Level: 3
View Source

Stop()

Stops the animated GIF.

Declaration
C#
Copy
public void Stop()
API Level: 5
View Source

UpdateImage()

Update image-relative properties synchronously. After call this API, All image properties updated.

Declaration
C#
Copy
protected virtual void UpdateImage()
Remarks

Current version ImageView property update asynchronously. If you want to guarantee that ImageView property setuped, Please call this ImageView.UpdateImage() API.

View Source

UpdateImage(Int32, PropertyValue, Boolean)

Lazy call to UpdateImage. Collect Properties need to be update, and set properties that starts the Processing.

If you want to update cachedImagePropertyMap, but don't want to request new visual creation, make requiredVisualCreation value as false. (Example : if we change SynchronousLoading property from 'true' to 'false', or if we call this function during UpdateImage)

Declaration
C#
Copy
protected virtual void UpdateImage(int key, PropertyValue value, bool requiredVisualCreation = true)
Parameters
Type Name Description
Int32 key
PropertyValue value
Boolean requiredVisualCreation

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
C#
Copy
public event EventHandler<ImageView.ResourceReadyEventArgs> ResourceReady
Event Type
Type Description
EventHandler<ImageView.ResourceReadyEventArgs>
API Level: 3

Implements

Extension Methods