* limitations under the License.
*
*/
-
+
namespace Tizen.NUI
{
internal static partial class Interop
public static extern bool Translate(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Drawable_SetOpacity")]
- public static extern bool SetOpacity(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+ public static extern void SetOpacity(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Drawable_GetOpacity")]
public static extern float GetOpacity(global::System.Runtime.InteropServices.HandleRef jarg1);
* limitations under the License.
*
*/
-
+
namespace Tizen.NUI
{
internal static partial class Interop
public static extern bool Close(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetFillColor")]
- public static extern bool SetFillColor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern void SetFillColor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetFillColor")]
public static extern global::System.IntPtr GetFillColor(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetFillRule")]
- public static extern bool SetFillRule(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+ public static extern void SetFillRule(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetFillRule")]
public static extern int GetFillRule(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetStrokeWidth")]
- public static extern bool SetStrokeWidth(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+ public static extern void SetStrokeWidth(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetStrokeWidth")]
public static extern float GetStrokeWidth(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetStrokeColor")]
- public static extern bool SetStrokeColor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern void SetStrokeColor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetStrokeColor")]
public static extern global::System.IntPtr GetStrokeColor(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetStrokeDash")]
- public static extern bool SetStrokeDash(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg2, int jarg3);
+ public static extern void SetStrokeDash(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg2, int jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetStrokeDashIndexOf")]
public static extern float GetStrokeDashIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
public static extern int GetStrokeDashCount(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetStrokeCap")]
- public static extern bool SetStrokeCap(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+ public static extern void SetStrokeCap(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetStrokeCap")]
public static extern int GetStrokeCap(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetStrokeJoin")]
- public static extern bool SetStrokeJoin(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+ public static extern void SetStrokeJoin(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetStrokeJoin")]
public static extern int GetStrokeJoin(global::System.Runtime.InteropServices.HandleRef jarg1);
}
/// <summary>
- /// Get the transparency value
+ /// The transparency level [0 ~ 1.0], 0 means totally transparent, while 1 means opaque.
/// </summary>
- /// <returns>The transparency level</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
- public float GetOpacity()
+ public float Opacity
{
- float ret = Interop.Drawable.GetOpacity(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Set the transparency value
- /// </summary>
- /// <param name="opacity">The transparency level [0 ~ 1.0], 0 means totally transparent, while 1 means opaque.</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetOpacity(float opacity)
- {
- bool ret = Interop.Drawable.SetOpacity(BaseHandle.getCPtr(this), opacity);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get {
+ float ret = Interop.Drawable.GetOpacity(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ set {
+ Interop.Drawable.SetOpacity(BaseHandle.getCPtr(this), value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
}
/// <summary>
}
/// <summary>
+ /// Enumeration for The fill rule of shape.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum FillRuleType
+ {
+ /// <summary>
+ /// Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape.
+ /// </summary>
+ Winding = 0,
+ /// <summary>
+ /// Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape.
+ /// </summary>
+ EvenOdd
+ }
+
+ /// <summary>
/// Enumeration for The cap style to be used for stroking the path.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public enum StrokeCap
+ public enum StrokeCapType
{
/// <summary>
/// The end of lines is rendered as a square around the last point.
/// numeration for The join style to be used for stroking the path.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public enum StrokeJoin
+ public enum StrokeJoinType
{
/// <summary>
/// Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the triangular region of the corner with a straight line between the outer corners of each stroke.
}
/// <summary>
- /// Enumeration for The fill rule of shape.
+ /// The color to use for filling the path.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public enum FillRule
+ public Color FillColor
+ {
+ get {
+ global::System.IntPtr cPtr = Interop.Shape.GetFillColor(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Color ret = Vector4.GetVector4FromPtr(cPtr);
+ return ret;
+ }
+ set {
+ Interop.Shape.SetFillColor(BaseHandle.getCPtr(this), Vector4.getCPtr(value));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// The current fill rule of the shape.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public FillRuleType FillRule
{
- /// <summary>
- /// Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape.
- /// </summary>
- Winding = 0,
- /// <summary>
- /// Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape.
- /// </summary>
- EvenOdd
+ get {
+ FillRuleType ret = (FillRuleType)Interop.Shape.GetFillRule(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ set {
+ Interop.Shape.SetFillRule(BaseHandle.getCPtr(this), (int)value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// The stroke width to use for stroking the path.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float StrokeWidth
+ {
+ get {
+ float ret = Interop.Shape.GetStrokeWidth(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ set {
+ Interop.Shape.SetStrokeWidth(BaseHandle.getCPtr(this), value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// The color to use for stroking the path.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Color StrokeColor
+ {
+ get {
+ global::System.IntPtr cPtr = Interop.Shape.GetStrokeColor(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Color ret = Vector4.GetVector4FromPtr(cPtr);
+ return ret;
+ }
+ set {
+ Interop.Shape.SetStrokeColor(BaseHandle.getCPtr(this), Vector4.getCPtr(value));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// The cap style to use for stroking the path. The cap will be used for capping the end point of a open subpath.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public StrokeCapType StrokeCap
+ {
+ get {
+ StrokeCapType ret = (StrokeCapType)Interop.Shape.GetStrokeCap(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ set {
+ Interop.Shape.SetStrokeCap(BaseHandle.getCPtr(this), (int)value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// The join style to use for stroking the path.
+ /// The join style will be used for joining the two line segment while stroking the path.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public StrokeJoinType StrokeJoin
+ {
+ get {
+ StrokeJoinType ret = (StrokeJoinType)Interop.Shape.GetStrokeJoin(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ set {
+ Interop.Shape.SetStrokeJoin(BaseHandle.getCPtr(this), (int)value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// The stroke dash pattern. The dash pattern is specified dash pattern.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public List<float> StrokeDash
+ {
+ get {
+ List<float> ret = new List<float>();
+ int patternCount = Interop.Shape.GetStrokeDashCount(BaseHandle.getCPtr(this));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ for (int i = 0; i < patternCount; i++)
+ {
+ ret.Add(Interop.Shape.GetStrokeDashIndexOf(BaseHandle.getCPtr(this), i));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ return ret;
+ }
+ set {
+ float[] pattern = new float[value.Count];
+ for (int i = 0; i < value.Count; i++)
+ {
+ pattern[i] = value[i];
+ }
+ Interop.Shape.SetStrokeDash(BaseHandle.getCPtr(this), pattern, value.Count);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
}
/// <summary>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
-
- /// <summary>
- /// Set the color to use for filling the path.
- /// </summary>
- /// <param name="color">The color value.</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetFillColor(Color color)
- {
- bool ret = Interop.Shape.SetFillColor(BaseHandle.getCPtr(this), Vector4.getCPtr(color));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Get the color to use for filling the path.
- /// </summary>
- /// <returns>Returns the color value.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Color GetFillColor()
- {
- global::System.IntPtr cPtr = Interop.Shape.GetFillColor(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- Color ret = Vector4.GetVector4FromPtr(cPtr);
- return ret;
- }
-
- /// <summary>
- /// Set the fill rule.
- /// </summary>
- /// <param name="rule">The current fill rule of the shape.</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetFillRule(FillRule rule)
- {
- bool ret = Interop.Shape.SetFillRule(BaseHandle.getCPtr(this), (int)rule);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Get the fill rule.
- /// </summary>
- /// <returns>Returns the current fill rule of the shape.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public FillRule GetFillRule()
- {
- FillRule ret = (FillRule)Interop.Shape.GetFillRule(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Set the stroke width to use for stroking the path.
- /// </summary>
- /// <param name="width">Stroke width to be used.</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetStrokeWidth(float width)
- {
- bool ret = Interop.Shape.SetStrokeWidth(BaseHandle.getCPtr(this), width);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Get the stroke width to use for stroking the path.
- /// </summary>
- /// <returns>Returns stroke width to be used.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float GetStrokeWidth()
- {
- float ret = Interop.Shape.GetStrokeWidth(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Set the color to use for stroking the path.
- /// </summary>
- /// <param name="color">The stroking color.</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetStrokeColor(Color color)
- {
- bool ret = Interop.Shape.SetStrokeColor(BaseHandle.getCPtr(this), Vector4.getCPtr(color));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Get the color to use for stroking the path.
- /// </summary>
- /// <returns>Returns the stroking color.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Color GetStrokeColor()
- {
- global::System.IntPtr cPtr = Interop.Shape.GetStrokeColor(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- Color ret = Vector4.GetVector4FromPtr(cPtr);
- return ret;
- }
-
- /// <summary>
- /// Sets the stroke dash pattern. The dash pattern is specified dash pattern.
- /// </summary>
- /// <param name="dashPattern">Length and a gap list.</param>
- /// <param name="count">Pattern list length</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetStrokeDash(float[] dashPattern, int count)
- {
- bool ret = Interop.Shape.SetStrokeDash(BaseHandle.getCPtr(this), dashPattern, count);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Gets the stroke dash pattern.
- /// </summary>
- /// <returns>Returns the stroke dash pattern. The dash pattern is specified dash pattern.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public List<float> GetStrokeDash()
- {
- List<float> ret = new List<float>();
-
- int patternCount = Interop.Shape.GetStrokeDashCount(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- for (int i = 0; i < patternCount; i++)
- {
- ret.Add(Interop.Shape.GetStrokeDashIndexOf(BaseHandle.getCPtr(this), i));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- return ret;
- }
-
- /// <summary>
- /// Set the cap style to use for stroking the path. The cap will be used for capping the end point of a open subpath.
- /// </summary>
- /// <param name="cap">Cap style to use.</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetStrokeCap(StrokeCap cap)
- {
- bool ret = Interop.Shape.SetStrokeCap(BaseHandle.getCPtr(this), (int)cap);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Get the cap style to use for stroking the path.
- /// </summary>
- /// <returns>Returns the cap style.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StrokeCap GetStrokeCap()
- {
- StrokeCap ret = (StrokeCap)Interop.Shape.GetStrokeCap(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Set the join style to use for stroking the path.
- /// The join style will be used for joining the two line segment while stroking the path.
- /// </summary>
- /// <param name="join">Join style to use.</param>
- /// <returns>True when it's successful. False otherwise.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool SetStrokeJoin(StrokeJoin join)
- {
- bool ret = Interop.Shape.SetStrokeJoin(BaseHandle.getCPtr(this), (int)join);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Get the join style to use for stroking the path.
- /// </summary>
- /// <returns>Returns join style to use.</returns>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StrokeJoin GetStrokeJoin()
- {
- StrokeJoin ret = (StrokeJoin)Interop.Shape.GetStrokeJoin(BaseHandle.getCPtr(this));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
}
}
PositionUsesPivotPoint = true,
};
- Shape shape1 = new Shape();
- shape1.AddRect(-50.0f, -50.0f, 100.0f, 100.0f, 10.0f, 10.0f);
- shape1.SetFillColor(new Color(0.5f, 1.0f, 0.0f, 1.0f));
- shape1.SetStrokeColor(new Color(0.5f, 0.0f, 0.0f, 0.5f));
- shape1.SetStrokeWidth(10.0f);
-
+ Shape shape1 = new Shape()
+ {
+ FillColor = new Color(0.5f, 1.0f, 0.0f, 1.0f),
+ StrokeColor = new Color(0.5f, 0.0f, 0.0f, 0.5f),
+ StrokeWidth = 10.0f,
+ };
shape1.Translate(100.0f, 100.0f);
shape1.Scale(1.2f);
shape1.Rotate(45.0f);
-
+ shape1.AddRect(-50.0f, -50.0f, 100.0f, 100.0f, 10.0f, 10.0f);
+
canvasView.AddDrawable(shape1);
- Shape shape2 = new Shape();
+ Shape shape2 = new Shape()
+ {
+ Opacity = 0.5f,
+ FillColor = new Color(0.0f, 0.0f, 1.0f, 1.0f),
+ StrokeColor = new Color(1.0f, 1.0f, 0.0f, 1.0f),
+ StrokeWidth = 10.0f,
+ StrokeDash = new List<float>() {15.0f, 30.0f},
+ };
shape2.AddCircle(0.0f, 0.0f, 150.0f, 100.0f);
- shape2.SetOpacity(0.5f);
- shape2.SetFillColor(new Color(0.0f, 0.0f, 1.0f, 1.0f));
- shape2.SetStrokeColor(new Color(1.0f, 1.0f, 0.0f, 1.0f));
- shape2.SetStrokeWidth(10.0f);
- shape2.SetStrokeDash(new float[] {15.0f, 30.0f}, 2);
-
shape2.Transform(new float[] {0.6f, 0.0f, 350.0f, 0.0f, 0.6f, 100.0f, 0.0f, 0.0f, 1.0f});
canvasView.AddDrawable(shape2);
- Shape shape3 = new Shape();
- shape3.AddArc(0.0f, 0.0f, 80.0f, 10.0f, 120.0f, true);
- shape3.SetStrokeColor(new Color(0.0f, 0.5f, 0.0f, 0.5f));
- shape3.SetStrokeWidth(10.0f);
+ Shape shape3 = new Shape()
+ {
+ StrokeColor = new Color(0.0f, 0.5f, 0.0f, 0.5f),
+ StrokeWidth = 10.0f,
+ StrokeJoin = Shape.StrokeJoinType.Miter,
+ };
shape3.Translate(100.0f, 300.0f);
- shape3.SetStrokeJoin(Shape.StrokeJoin.Miter);
+ shape3.AddArc(0.0f, 0.0f, 80.0f, 10.0f, 120.0f, true);
+
canvasView.AddDrawable(shape3);
- Shape shape4 = new Shape();
+ Shape shape4 = new Shape()
+ {
+ Opacity = 0.5f,
+ FillColor = new Color(0.0f, 0.5f, 0.0f, 0.5f),
+ StrokeColor = new Color(0.5f, 0.0f, 0.5f, 0.5f),
+ StrokeWidth = 30.0f,
+ FillRule = Shape.FillRuleType.EvenOdd,
+ StrokeJoin = Shape.StrokeJoinType.Round,
+ };
+ shape4.Scale(0.5f);
+ shape4.Translate(350.0f, 300.0f);
shape4.AddMoveTo(0.0f, -160.0f);
shape4.AddLineTo(125.0f, 160.0f);
shape4.AddLineTo(-180.0f, -45.0f);
shape4.AddLineTo(180.0f, -45.0f);
shape4.AddLineTo(-125.0f, 160.0f);
shape4.Close();
- shape4.SetFillColor(new Color(0.0f, 0.5f, 0.0f, 0.5f));
- shape4.SetStrokeColor(new Color(0.5f, 0.0f, 0.5f, 0.5f));
- shape4.SetStrokeWidth(30.0f);
- shape4.Translate(350.0f, 300.0f);
- shape4.Scale(0.5f);
- shape4.SetFillRule(Shape.FillRule.EvenOdd);
- shape4.SetStrokeJoin(Shape.StrokeJoin.Round);
- shape4.SetOpacity(0.5f);
canvasView.AddDrawable(shape4);
- shape = new Shape();
+ shape = new Shape()
+ {
+ Opacity = 0.5f,
+ FillColor = new Color(0.0f, 1.0f, 1.0f, 1.0f),
+ StrokeColor = new Color(0.5f, 1.0f, 0.5f, 1.0f),
+ StrokeWidth = 30.0f,
+ StrokeCap = Shape.StrokeCapType.Round,
+ };
+ shape.Translate(250.0f, 550.0f);
+ shape.Scale(0.5f);
shape.AddMoveTo(-1.0f, -165.0f);
shape.AddLineTo(53.0f, -56.0f);
shape.AddLineTo(174.0f, -39.0f);
shape.AddLineTo(-88.0f, 46.0f);
shape.AddLineTo(-174.0f, -38.0f);
shape.AddLineTo(-54.0f, -56.0f);
-
shape.Close();
- shape.SetFillColor(new Color(0.0f, 1.0f, 1.0f, 1.0f));
- shape.SetStrokeColor(new Color(0.5f, 1.0f, 0.5f, 1.0f));
- shape.SetStrokeWidth(30.0f);
- shape.SetStrokeCap(Shape.StrokeCap.Round);
- shape.Scale(0.6f);
- shape.Translate(250.0f, 550.0f);
- shape.SetOpacity(0.5f);
-
canvasView.AddDrawable(shape);
timer = new Timer(1000 / 32);
timer.Start();
- // Test Get APIs
- Color shape2Color = shape2.GetFillColor();
- log.Debug(tag, "Shape2 Color : " + shape2Color.R + " " + shape2Color.G + " " + shape2Color.B + " " + shape2Color.A + "\n");
-
- Color shape2StrockeColor = shape2.GetStrokeColor();
- log.Debug(tag, "Shape2 StrokeColor : " + shape2StrockeColor.R + " " + shape2StrockeColor.G + " " + shape2StrockeColor.B + " " + shape2StrockeColor.A + "\n");
+ // Test Getter
+ log.Debug(tag, "Shape2 Color : " + shape2.FillColor.R + " " + shape2.FillColor.G + " " + shape2.FillColor.B + " " + shape2.FillColor.A + "\n");
+ log.Debug(tag, "Shape2 StrokeColor : " + shape2.StrokeColor.R + " " + shape2.StrokeColor.G + " " + shape2.StrokeColor.B + " " + shape2.StrokeColor.A + "\n");
- log.Debug(tag, "Shape3 StrokeCap : " + shape3.GetStrokeCap() + "\n");
+ log.Debug(tag, "Shape3 StrokeCap : " + shape3.StrokeCap + "\n");
- log.Debug(tag, "Shape4 FillRule : " + shape4.GetFillRule() + "\n");
- log.Debug(tag, "Shape4 StrokeWidth : " + shape4.GetStrokeWidth() + "\n");
- log.Debug(tag, "Shape4 StrokeJoin : " + shape4.GetStrokeJoin() + "\n");
- log.Debug(tag, "Shape4 Opacity : " + shape4.GetOpacity() + "\n");
+ log.Debug(tag, "Shape4 FillRule : " + shape4.FillRule + "\n");
+ log.Debug(tag, "Shape4 StrokeWidth : " + shape4.StrokeWidth + "\n");
+ log.Debug(tag, "Shape4 StrokeJoin : " + shape4.StrokeJoin + "\n");
+ log.Debug(tag, "Shape4 Opacity : " + shape4.Opacity + "\n");
- List<float> pattern = shape2.GetStrokeDash();
- for (int i = 0; i < pattern.Count; i++)
+ for (int i = 0; i < shape2.StrokeDash.Count; i++)
{
- log.Debug(tag, "Shape4 StrokeDash : " + pattern[i] + "\n");
+ log.Debug(tag, "Shape4 StrokeDash : " + shape2.StrokeDash[i] + "\n");
}
root.Add(canvasView);
return true;
}
-
}
}