ImageVisualProperty.AlphaMaskURL,
ImageVisualProperty.CropToMask,
Visual.Property.VisualFittingMode,
+ ImageVisualProperty.SamplingMode,
ImageVisualProperty.DesiredWidth,
ImageVisualProperty.DesiredHeight,
ImageVisualProperty.ReleasePolicy,
}
}
+ /// <summary>
+ /// Gets or sets filtering options used when resizing images to the sample original pixels.<br />
+ /// If not supplied, the default is SamplingModeType.BoxThenLinear.<br />
+ /// For normal quad images only.<br />
+ /// Optional.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SamplingModeType SamplingMode
+ {
+ get
+ {
+ int ret = (int)SamplingModeType.BoxThenLinear;
+
+ using PropertyValue samplingMode = GetCachedImageVisualProperty(ImageVisualProperty.SamplingMode);
+ samplingMode?.Get(out ret);
+
+ return (SamplingModeType)ret;
+ }
+ set
+ {
+ using PropertyValue setValue = new PropertyValue((int)value);
+ UpdateImage(ImageVisualProperty.SamplingMode, setValue);
+ NotifyPropertyChanged();
+ }
+ }
+
/// <summary>
/// This method allows users to configure the blending of two images(previous and currnet) using alpha values.
/// </summary>
/// <summary>
/// For caching algorithms where a client strongly prefers a cache-hit to reuse a cached image.
/// </summary>
- DontCare
+ DontCare,
+ /// <summary>
+ /// Use Lanczos resample algorithm.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Lanczos,
+ /// <summary>
+ /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8 etc width and height and approximately the desired size, then apply Lanczos resample algorithm.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ BoxThenLanczos,
}
/// <summary>
}
}
+ /// <summary>
+ /// Gets or sets filtering options used when resizing images to the sample original pixels.<br />
+ /// If not supplied, the default is SamplingModeType.BoxThenLinear.<br />
+ /// For normal quad images only.<br />
+ /// Optional.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SamplingModeType SamplingMode
+ {
+ set
+ {
+ UpdateVisualProperty((int)Tizen.NUI.ImageVisualProperty.SamplingMode, new PropertyValue((int)value));
+ }
+ get
+ {
+ int ret = (int)SamplingModeType.BoxThenLinear;
+ var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.ImageVisualProperty.SamplingMode);
+ propertyValue?.Get(out ret);
+ return (SamplingModeType)ret;
+ }
+ }
+
/// <summary>
/// Gets or sets the desired image width.<br />
/// If not specified, the actual image width is used.<br />
{
focusIndicatorVisual.ResourceUrl = focusIndicatorImageUrl;
}
+ else if(e.Key.KeyPressedName == "6")
+ {
+ View focusedView = FocusManager.Instance.GetCurrentFocusView();
+ if(focusedView != null)
+ {
+ var thumbnailVisual = focusedView.FindVisualByName("thumbnailImage") as Visuals.ImageVisual;
+ if(thumbnailVisual != null)
+ {
+ thumbnailVisual.SamplingMode = GetNextSamplingModeType(thumbnailVisual.SamplingMode);
+ }
+ }
+ }
}
}
SynchronousSizing = true,
+ SamplingMode = SamplingModeType.BoxThenLanczos,
+
OffsetXPolicy = VisualTransformPolicyType.Absolute,
OffsetYPolicy = VisualTransformPolicyType.Absolute,
WidthPolicy = VisualTransformPolicyType.Absolute,
return view;
}
+
+ static private SamplingModeType GetNextSamplingModeType(SamplingModeType currentSamplingMode)
+ {
+ SamplingModeType nextSamplingMode = SamplingModeType.DontCare;
+ switch(currentSamplingMode)
+ {
+ case SamplingModeType.Box:
+ {
+ nextSamplingMode = SamplingModeType.Nearest;
+ break;
+ }
+ case SamplingModeType.Nearest:
+ {
+ nextSamplingMode = SamplingModeType.Linear;
+ break;
+ }
+ case SamplingModeType.Linear:
+ {
+ nextSamplingMode = SamplingModeType.BoxThenNearest;
+ break;
+ }
+ case SamplingModeType.BoxThenNearest:
+ {
+ nextSamplingMode = SamplingModeType.BoxThenLinear;
+ break;
+ }
+ case SamplingModeType.BoxThenLinear:
+ {
+ nextSamplingMode = SamplingModeType.Lanczos;
+ break;
+ }
+ case SamplingModeType.Lanczos:
+ {
+ nextSamplingMode = SamplingModeType.BoxThenLanczos;
+ break;
+ }
+ case SamplingModeType.BoxThenLanczos:
+ {
+ nextSamplingMode = SamplingModeType.DontCare;
+ break;
+ }
+ case SamplingModeType.DontCare:
+ default:
+ {
+ nextSamplingMode = SamplingModeType.Box;
+ break;
+ }
+ }
+ Tizen.Log.Error("NUI", $"Change sampling mode from [{currentSamplingMode}] to [{nextSamplingMode}]\n");
+
+ return nextSamplingMode;
+ }
}
}