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, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider
- Inheritance
- Derived
- Implements
-
System.IDisposable
Constructors
View SourceImageView()
Creates an initialized ImageView.
Declaration
public ImageView()
ImageView(bool)
Creates an initialized ImageView with setting the status of shown or hidden.
Declaration
public ImageView(bool shown)
Parameters
Type | Name | Description |
---|---|---|
bool | shown | false : Not displayed (hidden), true : displayed (shown) |
ImageView(string, bool)
Creates an initialized ImageView from a URL to an image resource with setting shown or hidden.
Declaration
public ImageView(string url, bool shown)
Parameters
Type | Name | Description |
---|---|---|
string | url | The URL of the image resource to display. |
bool | shown | false : Not displayed (hidden), true : displayed (shown) |
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. |
ImageView(ViewStyle)
Declaration
public ImageView(ViewStyle viewStyle)
Parameters
Type | Name | Description |
---|---|---|
ViewStyle | viewStyle |
Fields
View SourceAdjustViewSizeProperty
AdjustViewSizeProperty
Declaration
public static readonly BindableProperty AdjustViewSizeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
AlphaMaskURLProperty
AlphaMaskURLProperty
Declaration
public static readonly BindableProperty AlphaMaskURLProperty
Field Value
Type | Description |
---|---|
BindableProperty |
BorderOnlyProperty
Declaration
public static readonly BindableProperty BorderOnlyProperty
Field Value
Type | Description |
---|---|
BindableProperty |
BorderProperty
Declaration
public static readonly BindableProperty BorderProperty
Field Value
Type | Description |
---|---|
BindableProperty |
CropToMaskProperty
CropToMaskProperty
Declaration
public static readonly BindableProperty CropToMaskProperty
Field Value
Type | Description |
---|---|
BindableProperty |
DesiredHeightProperty
DesiredHeightProperty
Declaration
public static readonly BindableProperty DesiredHeightProperty
Field Value
Type | Description |
---|---|
BindableProperty |
DesiredWidthProperty
DesiredWidthProperty
Declaration
public static readonly BindableProperty DesiredWidthProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FastTrackUploadingProperty
FastTrackUploadingProperty
Declaration
public static readonly BindableProperty FastTrackUploadingProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FittingModeProperty
FittingModeProperty
Declaration
public static readonly BindableProperty FittingModeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ImageColorProperty
ImageColorProperty
Declaration
public static readonly BindableProperty ImageColorProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ImageMapProperty
ImageMapProperty
Declaration
public static readonly BindableProperty ImageMapProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ImageProperty
Declaration
public static readonly BindableProperty ImageProperty
Field Value
Type | Description |
---|---|
BindableProperty |
MaskingModeProperty
MaskingModeProperty
Declaration
public static readonly BindableProperty MaskingModeProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OrientationCorrectionProperty
Declaration
public static readonly BindableProperty OrientationCorrectionProperty
Field Value
Type | Description |
---|---|
BindableProperty |
PixelAreaProperty
Declaration
public static readonly BindableProperty PixelAreaProperty
Field Value
Type | Description |
---|---|
BindableProperty |
PlaceHolderUrlProperty
PlaceHolderUrlProperty
Declaration
public static readonly BindableProperty PlaceHolderUrlProperty
Field Value
Type | Description |
---|---|
BindableProperty |
PreMultipliedAlphaProperty
Declaration
public static readonly BindableProperty PreMultipliedAlphaProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ReleasePolicyProperty
ReleasePolicyProperty
Declaration
public static readonly BindableProperty ReleasePolicyProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ResourceUrlProperty
Declaration
public static readonly BindableProperty ResourceUrlProperty
Field Value
Type | Description |
---|---|
BindableProperty |
SynchronosLoadingProperty
Declaration
public static readonly BindableProperty SynchronosLoadingProperty
Field Value
Type | Description |
---|---|
BindableProperty |
SynchronousLoadingProperty
Declaration
public static readonly BindableProperty SynchronousLoadingProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TransitionEffectProperty
Declaration
public static readonly BindableProperty TransitionEffectProperty
Field Value
Type | Description |
---|---|
BindableProperty |
WrapModeUProperty
WrapModeUProperty
Declaration
public static readonly BindableProperty WrapModeUProperty
Field Value
Type | Description |
---|---|
BindableProperty |
WrapModeVProperty
WrapModeVProperty
Declaration
public static readonly BindableProperty WrapModeVProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Properties
View SourceAdjustViewSize
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).
AlphaMaskURL
Gets or sets the URL of the alpha mask.
Optional.
Declaration
public string AlphaMaskURL { get; set; }
Property Value
Type | Description |
---|---|
string |
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.
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 |
CropToMask
Whether to crop image to mask or scale mask to fit image.
Declaration
public bool CropToMask { get; set; }
Property Value
Type | Description |
---|---|
bool |
DesiredHeight
Gets or sets the desired image height.
If not specified, the actual image height is used.
For normal quad images only.
Optional.
Declaration
public int DesiredHeight { get; set; }
Property Value
Type | Description |
---|---|
int |
DesiredWidth
Gets or sets the desired image width.
If not specified, the actual image width is used.
For normal quad images only.
Optional.
Declaration
public int DesiredWidth { get; set; }
Property Value
Type | Description |
---|---|
int |
FastTrackUploading
Gets or sets whether to apply fast track uploading or not.
Declaration
public bool FastTrackUploading { get; set; }
Property Value
Type | Description |
---|---|
bool |
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.
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
public FittingModeType FittingMode { get; set; }
Property Value
Type | Description |
---|---|
FittingModeType |
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
ImageColor
The mixed color value for the image.
Declaration
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
var imageView = new ImageView();
imageView.ImageColor = new Color(0.5f, 0.1f, 0.0f, 1.0f);
This way to set the property is prohibited
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
public PropertyMap ImageMap { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
LoadingStatus
Gets the loading state of the visual resource.
Declaration
public ImageView.LoadingStatusType LoadingStatus { get; }
Property Value
Type | Description |
---|---|
ImageView.LoadingStatusType |
MaskingMode
Gets or sets whether to apply mask on GPU or not.
Declaration
public ImageView.MaskingModeType MaskingMode { get; set; }
Property Value
Type | Description |
---|---|
ImageView.MaskingModeType |
OrientationCorrection
Gets or sets whether to automatically correct the orientation of an image.
Declaration
public bool OrientationCorrection { get; set; }
Property Value
Type | Description |
---|---|
bool |
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.
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
public string PlaceHolderUrl { get; set; }
Property Value
Type | Description |
---|---|
string |
PreMultipliedAlpha
ImageView PreMultipliedAlpha, type Boolean.
Image must be initialized.
Declaration
public bool PreMultipliedAlpha { get; set; }
Property Value
Type | Description |
---|---|
bool |
ReleasePolicy
Gets or sets ReleasePolicy for image.
If not supplied, the default is ReleasePolicyType.Detached.
Declaration
public ReleasePolicyType ReleasePolicy { get; set; }
Property Value
Type | Description |
---|---|
ReleasePolicyType |
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 |
SynchronosLoading
Gets or sets whether to synchronous loading the resourceurl of image.
Declaration
public bool SynchronosLoading { get; set; }
Property Value
Type | Description |
---|---|
bool |
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.
TransitionEffect
Gets or sets whether the image use TransitionEffect or not
Declaration
public bool TransitionEffect { get; set; }
Property Value
Type | Description |
---|---|
bool |
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
public WrapModeType WrapModeU { get; set; }
Property Value
Type | Description |
---|---|
WrapModeType |
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
public WrapModeType WrapModeV { get; set; }
Property Value
Type | Description |
---|---|
WrapModeType |
Methods
View SourceCheckResourceReady()
Declaration
protected override bool CheckResourceReady()
Returns
Type | Description |
---|---|
bool |
Overrides
View SourceCreateViewStyle()
Get attributes, it is abstract function and must be override.
Declaration
protected override ViewStyle CreateViewStyle()
Returns
Type | Description |
---|---|
ViewStyle |
Overrides
View SourceDispose(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 SourceDownCast(BaseHandle)
Downcasts a handle to imageView handle.
Declaration
public static ImageView DownCast(BaseHandle handle)
Parameters
Type | Name | Description |
---|---|---|
BaseHandle | handle |
Returns
Type | Description |
---|---|
ImageView |
GetCachedImageVisualProperty(int)
Get image visual property from NUI cached image map by key. If there is no matched value, return null.
Declaration
protected virtual PropertyValue GetCachedImageVisualProperty(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key |
Returns
Type | Description |
---|---|
PropertyValue |
GetImageVisualProperty(int)
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
protected virtual PropertyValue GetImageVisualProperty(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key |
Returns
Type | Description |
---|---|
PropertyValue |
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 |
MergeCachedImageVisualProperty(PropertyMap)
Update NUI cached image visual property map by inputed property map.
Declaration
protected virtual void MergeCachedImageVisualProperty(PropertyMap map)
Parameters
Type | Name | Description |
---|---|---|
PropertyMap | map |
Remarks
For performance issue, we will collect only "cachedImagePropertyKeyList" hold.
Pause()
Pauses the animated GIF.
Declaration
public void Pause()
Play()
Plays the animated GIF. This is also the default playback mode.
Declaration
public void Play()
ReleaseSwigCPtr(HandleRef)
Declaration
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type | Name | Description |
---|---|---|
Tizen.System.Runtime.InteropServices.HandleRef | swigCPtr |
Overrides
View SourceReload()
Forcefully reloads the image. All the visuals using this image will reload to the latest image.
Declaration
public void Reload()
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. |
Stop()
Stops the animated GIF.
Declaration
public void Stop()
UpdateImage()
Update image-relative properties synchronously. After call this API, All image properties updated.
Declaration
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.
UpdateImage(int, PropertyValue, bool)
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
protected virtual void UpdateImage(int key, PropertyValue value, bool requiredVisualCreation = true)
Parameters
Type | Name | Description |
---|---|---|
int | key | |
PropertyValue | value | |
bool | requiredVisualCreation |
Events
View SourceResourceReady
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 |
---|---|
EventHandler<><ResourceReadyEventArgs> |