2 * Copyright (c) 2017 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 System.Runtime.InteropServices;
21 using Tizen.NUI.UIComponents;
22 using Tizen.NUI.BaseComponents;
23 //using Tizen.Applications;
25 //------------------------------------------------------------------------------
26 // <manual-generated />
28 // This file can only run on Tizen target. You should compile it with DaliApplication.cs, and
29 // add tizen c# application related library as reference.
30 //------------------------------------------------------------------------------
31 namespace RelativeVectorTest
33 class Example : NUIApplication
35 private Animation _animation;
36 private ImageView _imageView;
37 private Window _window;
38 private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res";
40 public Example():base()
44 public Example(string stylesheet):base(stylesheet)
48 public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode)
52 protected override void OnCreate()
58 private void Initialize()
60 _window = Window.Instance;
61 _window.TouchEvent += OnWindowTouched;
63 _imageView = new ImageView();
64 _imageView.ResourceUrl = resources+"/images/gallery-3.jpg";
65 _imageView.ParentOrigin = ParentOrigin.Center;
66 _imageView.PivotPoint = PivotPoint.Center;
67 _imageView.PixelArea = new RelativeVector4(0.0f, 0.0f, 0.0f, 0.0f);
69 _window.Add(_imageView);
72 // Callback for window touched signal handling
73 private void OnWindowTouched(object sender, Window.TouchEventArgs e)
75 // Only animate the _text label when touch down happens
76 if (e.Touch.GetState(0) == PointStateType.Down)
78 // Create a new _animation
84 _animation = new Animation(1000); // 1 second of duration
85 _animation.AnimateTo(_imageView, "PixelArea", new RelativeVector4(0.0f, 0.0f, 1.0f, 1.0f), 0, 1000);
86 _animation.EndAction = Animation.EndActions.Discard;
87 _animation.PlayRange = new RelativeVector2(0.2f, 0.8f);
89 // Play the _animation
95 /// The main entry point for the application.
99 static void _Main(string[] args)
101 Tizen.Log.Debug("NUI", "Hello mono world.");
102 Example example = new Example("stylesheet", WindowMode.Transparent);