internal static readonly int IMAGE_VISUAL_PIXEL_AREA = NDalicPINVOKE.IMAGE_VISUAL_PIXEL_AREA_get();
internal static readonly int IMAGE_VISUAL_WRAP_MODE_U = NDalicPINVOKE.IMAGE_VISUAL_WRAP_MODE_U_get();
internal static readonly int IMAGE_VISUAL_WRAP_MODE_V = NDalicPINVOKE.IMAGE_VISUAL_WRAP_MODE_V_get();
+ internal static readonly int IMAGE_VISUAL_BATCH_SIZE = NDalicPINVOKE.IMAGE_VISUAL_BATCH_SIZE_get();
+ internal static readonly int IMAGE_VISUAL_CACHE_SIZE = NDalicPINVOKE.IMAGE_VISUAL_CACHE_SIZE_get();
+ internal static readonly int IMAGE_VISUAL_FRAME_DELAY = NDalicPINVOKE.IMAGE_VISUAL_FRAME_DELAY_get();
+ internal static readonly int IMAGE_VISUAL_MASK_CONTENT_SCALE = NDalicPINVOKE.IMAGE_VISUAL_MASK_CONTENT_SCALE_get();
+ internal static readonly int IMAGE_VISUAL_CROP_TO_MASK = NDalicPINVOKE.IMAGE_VISUAL_CROP_TO_MASK_get();
internal static readonly int MESH_VISUAL_OBJECT_URL = NDalicPINVOKE.MESH_VISUAL_OBJECT_URL_get();
internal static readonly int MESH_VISUAL_MATERIAL_URL = NDalicPINVOKE.MESH_VISUAL_MATERIAL_URL_get();
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_WRAP_MODE_V_get")]
public static extern int IMAGE_VISUAL_WRAP_MODE_V_get();
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_BATCH_SIZE_get")]
+ public static extern int IMAGE_VISUAL_BATCH_SIZE_get();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CACHE_SIZE_get")]
+ public static extern int IMAGE_VISUAL_CACHE_SIZE_get();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_FRAME_DELAY_get")]
+ public static extern int IMAGE_VISUAL_FRAME_DELAY_get();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_MASK_CONTENT_SCALE_get")]
+ public static extern int IMAGE_VISUAL_MASK_CONTENT_SCALE_get();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CROP_TO_MASK_get")]
+ public static extern int IMAGE_VISUAL_CROP_TO_MASK_get();
+
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_MESH_VISUAL_OBJECT_URL_get")]
public static extern int MESH_VISUAL_OBJECT_URL_get();
namespace Tizen.NUI
{
+ using System.Collections.Generic;
using Tizen.NUI.BaseComponents;
/// <summary>
private Vector4 _pixelArea = null;
private WrapModeType? _wrapModeU = null;
private WrapModeType? _wrapModeV = null;
+ private float? _maskContentScale = null;
+ private bool? _cropToMask = null;
/// <summary>
/// Get or set the URL of the image.<br>
/// Mandatory.
/// </summary>
+
public string URL
{
get
}
}
+
/// <summary>
/// Get or set the URL of the alpha mask.<br>
/// Optional.
}
}
+ public float MaskContentScale
+ {
+ get
+ {
+ return _maskContentScale ?? 1.0f;
+ }
+ set
+ {
+ _maskContentScale = value;
+ UpdateVisual();
+ }
+ }
+
+ public bool CropToMask
+ {
+ get
+ {
+ return _cropToMask ?? false;
+ }
+ set
+ {
+ _cropToMask = value;
+ UpdateVisual();
+ }
+ }
+
protected override void ComposingPropertyMap()
{
if (_url != null)
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
+ if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
}
}
}
{
}
- private string _url = null;
+ private List<string> _urls = null;
+ private int? _batchSize = null;
+ private int? _cacheSize = null;
+ private float? _frameDelay = null;
public string URL
{
get
{
- return _url;
+ if( _urls == null )
+ {
+ return _urls[0];
+ }
+ else
+ {
+ return null;
+ }
}
set
{
- _url = value;
+ if( _urls == null )
+ {
+ _urls = new List<string>();
+ _urls.Add(value);
+ }
+ else
+ {
+ _urls[0] = value;
+ }
+ UpdateVisual();
+ }
+ }
+
+ public List<string> URLS
+ {
+ get
+ {
+ return _urls;
+ }
+ set
+ {
+ _urls = value;
+ UpdateVisual();
+ }
+ }
+
+ public int BatchSize
+ {
+ get
+ {
+ return _batchSize ?? 1;
+ }
+ set
+ {
+ _batchSize = value;
+ UpdateVisual();
+ }
+ }
+
+ public int CacheSize
+ {
+ get
+ {
+ return _cacheSize ?? 1;
+ }
+ set
+ {
+ _cacheSize = value;
+ UpdateVisual();
+ }
+ }
+ public float FrameDelay
+ {
+ get
+ {
+ return _frameDelay ?? 0.1f;
+ }
+ set
+ {
+ _frameDelay = value;
UpdateVisual();
}
}
protected override void ComposingPropertyMap()
{
- if (_url != null)
+ if (_urls != null)
{
_outputVisualMap = new PropertyMap();
_outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
- _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
+ if( _urls.Count == 1 )
+ {
+ _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
+ }
+ else
+ {
+ var urlArray = new PropertyArray();
+ foreach( var url in _urls)
+ {
+ urlArray.Add(new PropertyValue(url));
+ }
+ _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
+ }
+ if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
+ if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
+ if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }