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.
19 using Tizen.NUI.BaseComponents;
20 using Tizen.NUI.Components;
22 namespace NUITizenGallery
24 public partial class RotationTest1Page : ContentPage
26 private readonly string ResourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/";
27 public RotationTest1Page()
29 InitializeComponent();
30 img.SetImage(ResourcePath + "a.jpg");
33 btn.Clicked += (o, e) =>
38 btn.Orientation = new Rotation(new Radian(new Degree(45.0f)), Vector3.ZAxis);
42 btn.Orientation = new Rotation(new Radian(new Degree(-45.0f)), Vector3.ZAxis);
43 btn.Orientation = new Rotation(new Radian(new Degree(45.0f)), Vector3.XAxis);
47 btn.Orientation = new Rotation(new Radian(new Degree(0.0f)), Vector3.ZAxis);
48 btn.Orientation = new Rotation(new Radian(new Degree(-45.0f)), Vector3.XAxis);
49 btn.Orientation = new Rotation(new Radian(new Degree(45.0f)), Vector3.YAxis);
53 btn.Orientation = new Rotation(new Radian(new Degree(45.0f)), Vector3.ZAxis);
54 btn.Orientation = new Rotation(new Radian(new Degree(45.0f)), Vector3.XAxis);
55 btn.Orientation = new Rotation(new Radian(new Degree(0.0f)), Vector3.YAxis);
59 btn.Orientation = new Rotation(new Radian(new Degree(-45.0f)), Vector3.ZAxis);
60 btn.Orientation = new Rotation(new Radian(new Degree(-45.0f)), Vector3.XAxis);
61 btn.Orientation = new Rotation(new Radian(new Degree(-45.0f)), Vector3.YAxis);
65 sliderX.ValueChanged += (s, e) =>
67 btn.Orientation = new Rotation(new Radian(new Degree(sliderX.CurrentValue)), Vector3.XAxis);
68 rect.Orientation = new Rotation(new Radian(new Degree(sliderX.CurrentValue)), Vector3.XAxis);
69 img.Orientation = new Rotation(new Radian(new Degree(sliderX.CurrentValue)), Vector3.XAxis);
70 label.Orientation = new Rotation(new Radian(new Degree(sliderX.CurrentValue)), Vector3.XAxis);
72 sliderY.ValueChanged += (s, e) =>
74 btn.Orientation = new Rotation(new Radian(new Degree(sliderY.CurrentValue)), Vector3.YAxis);
75 rect.Orientation = new Rotation(new Radian(new Degree(sliderY.CurrentValue)), Vector3.YAxis);
76 img.Orientation = new Rotation(new Radian(new Degree(sliderY.CurrentValue)), Vector3.YAxis);
77 label.Orientation = new Rotation(new Radian(new Degree(sliderY.CurrentValue)), Vector3.YAxis);
79 sliderZ.ValueChanged += (s, e) =>
81 btn.Orientation = new Rotation(new Radian(new Degree(sliderZ.CurrentValue)), Vector3.ZAxis);
82 rect.Orientation = new Rotation(new Radian(new Degree(sliderZ.CurrentValue)), Vector3.ZAxis);
83 img.Orientation = new Rotation(new Radian(new Degree(sliderZ.CurrentValue)), Vector3.ZAxis);
84 label.Orientation = new Rotation(new Radian(new Degree(sliderZ.CurrentValue)), Vector3.ZAxis);