2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.ComponentModel;
19 namespace Tizen.NUI.BaseComponents
21 namespace VectorGraphics
24 /// Drawable is a object class for drawing a vector primitive.
26 [EditorBrowsable(EditorBrowsableState.Never)]
27 public class Drawable : BaseHandle
30 /// Creates an initialized drawable.
32 [EditorBrowsable(EditorBrowsableState.Never)]
35 internal Drawable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
40 /// Get the transparency value
42 /// <returns>The transparency level</returns>
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 public float GetOpacity()
46 return Interop.Drawable.GetOpacity(BaseHandle.getCPtr(this));
50 /// Set the transparency value
52 /// <param name="opacity">The transparency level [0 ~ 1.0], 0 means totally transparent, while 1 means opaque.</param>
53 /// <returns>True when it's successful. False otherwise.</returns>
54 [EditorBrowsable(EditorBrowsableState.Never)]
55 public bool SetOpacity(float opacity)
57 if (Interop.Drawable.SetOpacity(BaseHandle.getCPtr(this), opacity))
63 /// Set the angle of rotation transformation.
65 /// <param name="degree">The degree value of angle.</param>
66 /// <returns>True when it's successful. False otherwise.</returns>
67 [EditorBrowsable(EditorBrowsableState.Never)]
68 public bool Rotate(float degree)
70 if (Interop.Drawable.Rotate(BaseHandle.getCPtr(this), degree))
76 /// Set the scale value of scale transformation.
78 /// <param name="factor">The scale factor value.</param>
79 /// <returns>True when it's successful. False otherwise.</returns>
80 [EditorBrowsable(EditorBrowsableState.Never)]
81 public bool Scale(float factor)
83 if (Interop.Drawable.Scale(BaseHandle.getCPtr(this), factor))
89 /// Set the matrix value for affine transform.
91 /// <param name="matrix">The float type array of 3x3 matrix.</param>
92 /// <returns>True when it's successful. False otherwise.</returns>
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public bool Transform(float[] matrix)
96 if (Interop.Drawable.Transform(BaseHandle.getCPtr(this), matrix))
102 /// Set the x, y movement value of translate transformation.
104 /// <param name="x">The x-axis movement value.</param>
105 /// <param name="y">The y-axis movement value.</param>
106 /// <returns>True when it's successful. False otherwise.</returns>
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 public bool Translate(float x, float y)
110 if (Interop.Drawable.Translate(BaseHandle.getCPtr(this), x, y))