2 * Copyright(c) 2022 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.
18 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Components;
21 namespace NUITizenGallery
23 public partial class GraphicsTypeTestPage : ContentPage
25 public GraphicsTypeTestPage()
27 InitializeComponent();
29 var Manager = GraphicsTypeManager.Instance;
31 InfoText.Text = $"Dpi={Manager.Dpi} ScaledDpi={Manager.ScaledDpi} ScalingFactor={Manager.ScalingFactor}";
33 PixelRect.Position = new Position(100f, 200f);
34 PixelRect.Size = new Size(300f, 100f);
35 PixelText.Position2D = new Position2D(100, 310);
36 PixelText.WidthSpecification = 300;
37 PixelText.HeightSpecification = 90;
38 PixelText.Text = "Pixel size 20";
39 PixelText.PixelSize = 20f;
40 PointText.Position2D = new Position2D(100, 410);
41 PointText.WidthSpecification = 300;
42 PointText.HeightSpecification = 90;
43 PointText.Text = "Point size 20";
44 PointText.PointSize = 20f;
46 DpRect.Position = new Position(100f, 200f).DpToPx();
47 DpRect.Size = new Size(300f, 100f).DpToPx();
48 DpPixelText.Position2D = new Position2D(100, 310).DpToPx();
49 DpPixelText.WidthSpecification = 300.DpToPx();
50 DpPixelText.HeightSpecification = 90.DpToPx();
51 DpPixelText.Text = $"Dp Pixel Size {20f.DpToPx()}";
52 DpPixelText.PixelSize = 20f.DpToPx();
53 DpPointText.Position2D = new Position2D(100, 410).DpToPx();
54 DpPointText.WidthSpecification = 300.DpToPx();
55 DpPointText.HeightSpecification = 90.DpToPx();
56 DpPointText.Text = $"Dp Point Size {20f.DpToPt()}";
58 SpRect.Position = new Position(100f, 200f).SpToPx();
59 SpRect.Size = new Size(300f, 100f).SpToPx();
60 SpPixelText.Position2D = new Position2D(100, 310).SpToPx();
61 SpPixelText.WidthSpecification = 300.SpToPx();
62 SpPixelText.HeightSpecification = 90.SpToPx();
63 SpPixelText.Text = $"Sp Pixel Size {20f.SpToPx()}";
64 SpPointText.Position2D = new Position2D(100, 410).SpToPx();
65 SpPointText.WidthSpecification = 300.SpToPx();
66 SpPointText.HeightSpecification = 90.SpToPx();
67 SpPointText.Text = $"Sp Point Size {20f.SpToPt()}";
68 SpPointText.PointSize = 20f.SpToPt();