[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Image.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.IO;
19 using System.Threading;
20 using System.Threading.Tasks;
21
22 namespace ElmSharp
23 {
24     /// <summary>
25     /// The Image is a widget that allows one to load and display an image file on it,
26     /// be it from a disk file or from a memory region.
27     /// Inherits Widget.
28     /// </summary>
29     /// <since_tizen> preview </since_tizen>
30     [Obsolete("This has been deprecated in API12")]
31     public class Image : Widget
32     {
33         bool _canScaleUp = true;
34         bool _canScaleDown = true;
35         SmartEvent _clicked;
36         Color _color = Color.Default;
37
38         EvasImage _imageObject = null;
39
40         /// <summary>
41         /// Creates and initializes a new instance of the Image class.
42         /// </summary>
43         /// <param name="parent">The parent is a given container, which will be attached by the image as a child. It's <see cref="EvasObject"/> type.</param>
44         /// <since_tizen> preview </since_tizen>
45         [Obsolete("This has been deprecated in API12")]
46         public Image(EvasObject parent) : base(parent)
47         {
48             _clicked = new SmartEvent(this, "clicked");
49             _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty);
50         }
51
52         /// <summary>
53         /// Clicked will be triggered when the image is clicked.
54         /// </summary>
55         /// <since_tizen> preview </since_tizen>
56         [Obsolete("This has been deprecated in API12")]
57         public event EventHandler Clicked;
58
59         /// <summary>
60         /// LoadingCompleted will be triggered when the image is loaded completely.
61         /// </summary>
62         /// <since_tizen> preview </since_tizen>
63         [Obsolete("This has been deprecated in API12")]
64         public event EventHandler LoadingCompleted;
65
66         /// <summary>
67         /// Clicked will be triggered when the image fails to load.
68         /// </summary>
69         /// <since_tizen> preview </since_tizen>
70         [Obsolete("This has been deprecated in API12")]
71         public event EventHandler LoadingFailed;
72
73         /// <summary>
74         /// Gets the file that is used as an image.
75         /// </summary>
76         /// <since_tizen> preview </since_tizen>
77         [Obsolete("This has been deprecated in API12")]
78         public string File
79         {
80             get
81             {
82                 return Interop.Elementary.elm_image_file_get(RealHandle);
83             }
84         }
85
86         /// <summary>
87         /// Sets or gets the smooth effect for an image.
88         /// </summary>
89         /// <since_tizen> preview </since_tizen>
90         [Obsolete("This has been deprecated in API12")]
91         public bool IsSmooth
92         {
93             get
94             {
95                 return Interop.Elementary.elm_image_smooth_get(RealHandle);
96             }
97             set
98             {
99                 Interop.Elementary.elm_image_smooth_set(RealHandle, value);
100             }
101         }
102
103         /// <summary>
104         /// Sets or gets whether scaling is disabled on the object.
105         /// </summary>
106         /// <since_tizen> preview </since_tizen>
107         [Obsolete("This has been deprecated in API12")]
108         public bool IsScaling
109         {
110             get
111             {
112                 return !Interop.Elementary.elm_image_no_scale_get(RealHandle);
113             }
114             set
115             {
116                 Interop.Elementary.elm_image_no_scale_set(RealHandle, !value);
117             }
118         }
119
120         /// <summary>
121         /// Sets or gets whether the object is down resizable.
122         /// </summary>
123         /// <since_tizen> preview </since_tizen>
124         [Obsolete("This has been deprecated in API12")]
125         public bool CanScaleDown
126         {
127             get
128             {
129                 return _canScaleDown;
130             }
131             set
132             {
133                 _canScaleDown = value;
134                 Interop.Elementary.elm_image_resizable_set(RealHandle, _canScaleUp, _canScaleDown);
135             }
136         }
137
138         /// <summary>
139         /// Sets or gets whether the object is up resizable.
140         /// </summary>
141         /// <since_tizen> preview </since_tizen>
142         [Obsolete("This has been deprecated in API12")]
143         public bool CanScaleUp
144         {
145             get
146             {
147                 return _canScaleUp;
148             }
149             set
150             {
151                 _canScaleUp = value;
152                 Interop.Elementary.elm_image_resizable_set(RealHandle, _canScaleUp, _canScaleDown);
153             }
154         }
155
156         /// <summary>
157         /// Sets or gets whether the image fills the entire object area, when keeping the aspect ratio.
158         /// </summary>
159         /// <since_tizen> preview </since_tizen>
160         [Obsolete("This has been deprecated in API12")]
161         public bool CanFillOutside
162         {
163             get
164             {
165                 return Interop.Elementary.elm_image_fill_outside_get(RealHandle);
166             }
167             set
168             {
169                 Interop.Elementary.elm_image_fill_outside_set(RealHandle, value);
170             }
171         }
172
173         /// <summary>
174         /// Sets or gets the prescale size for the image.
175         /// </summary>
176         /// <since_tizen> preview </since_tizen>
177         [Obsolete("This has been deprecated in API12")]
178         public int PrescaleSize
179         {
180             get
181             {
182                 return Interop.Elementary.elm_image_prescale_get(RealHandle);
183             }
184             set
185             {
186                 Interop.Elementary.elm_image_prescale_set(RealHandle, value);
187             }
188         }
189
190         /// <summary>
191         /// Sets or gets whether the original aspect ratio of the image should be kept on resize.
192         /// </summary>
193         /// <since_tizen> preview </since_tizen>
194         [Obsolete("This has been deprecated in API12")]
195         public bool IsFixedAspect
196         {
197             get
198             {
199                 return Interop.Elementary.elm_image_aspect_fixed_get(RealHandle);
200             }
201             set
202             {
203                 Interop.Elementary.elm_image_aspect_fixed_set(RealHandle, value);
204             }
205         }
206
207         /// <summary>
208         /// Sets or gets whether an image object (which supports animation) is to animate itself.
209         /// </summary>
210         /// <since_tizen> preview </since_tizen>
211         [Obsolete("This has been deprecated in API12")]
212         public bool IsAnimated
213         {
214             get
215             {
216                 return Interop.Elementary.elm_image_animated_get(RealHandle);
217             }
218             set
219             {
220                 Interop.Elementary.elm_image_animated_set(RealHandle, value);
221             }
222         }
223
224         /// <summary>
225         /// Gets whether an image object supports animation.
226         /// </summary>
227         /// <since_tizen> preview </since_tizen>
228         [Obsolete("This has been deprecated in API12")]
229         public bool IsAnimatedAvailable
230         {
231             get
232             {
233                 return Interop.Elementary.elm_image_animated_available_get(RealHandle);
234             }
235         }
236
237         /// <summary>
238         /// Sets or gets whether an image object is under animation.
239         /// </summary>
240         /// <remarks>
241         /// An image object, even if it supports animation, will be displayed by default without animation.
242         /// To actually start playing any image object's animation, <see cref="IsAnimated"/> should be TRUE before setting this property true.
243         /// </remarks>
244         /// <since_tizen> preview </since_tizen>
245         [Obsolete("This has been deprecated in API12")]
246         public bool IsAnimationPlaying
247         {
248             get
249             {
250                 return Interop.Elementary.elm_image_animated_play_get(RealHandle);
251             }
252             set
253             {
254                 Interop.Elementary.elm_image_animated_play_set(RealHandle, value);
255             }
256         }
257
258         /// <summary>
259         /// Sets or gets whether the image is 'editable'.
260         /// </summary>
261         /// <since_tizen> preview </since_tizen>
262         [Obsolete("This has been deprecated in API12")]
263         public bool IsEditable
264         {
265             get
266             {
267                 return Interop.Elementary.elm_image_editable_get(RealHandle);
268             }
269             set
270             {
271                 Interop.Elementary.elm_image_editable_set(RealHandle, value);
272             }
273         }
274
275         /// <summary>
276         /// Gets the current size of the image.
277         /// </summary>
278         /// <since_tizen> preview </since_tizen>
279         [Obsolete("This has been deprecated in API12")]
280         public Size ObjectSize
281         {
282             get
283             {
284                 Interop.Elementary.elm_image_object_size_get(RealHandle, out int w, out int h);
285                 return new Size(w, h);
286             }
287         }
288
289         /// <summary>
290         /// Sets or gets whether the alpha channel data is being used on the given image object.
291         /// </summary>
292         /// <since_tizen> preview </since_tizen>
293         [Obsolete("This has been deprecated in API12")]
294         public bool IsOpaque
295         {
296             get
297             {
298                 if (ImageObject != null)
299                 {
300                     return ImageObject.IsOpaque;
301                 }
302                 return false;
303             }
304             set
305             {
306                 if (ImageObject != null)
307                 {
308                     ImageObject.IsOpaque = value;
309                 }
310             }
311         }
312
313         /// <summary>
314         /// Sets or gets the image orientation.
315         /// </summary>
316         /// <since_tizen> preview </since_tizen>
317         [Obsolete("This has been deprecated in API12")]
318         public ImageOrientation Orientation
319         {
320             get
321             {
322                 return (ImageOrientation)Interop.Elementary.elm_image_orient_get(RealHandle);
323             }
324             set
325             {
326                 Interop.Elementary.elm_image_orient_set(RealHandle, (int)value);
327             }
328         }
329
330         /// <summary>
331         /// Sets or gets the image color.
332         /// </summary>
333         /// <since_tizen> preview </since_tizen>
334         [Obsolete("This has been deprecated in API12")]
335         public override Color Color
336         {
337             get
338             {
339                 return _color;
340             }
341             set
342             {
343                 if (ImageObject != null)
344                 {
345                     if (value.IsDefault)
346                     {
347                         ImageObject.Color = Color.FromRgba(255, 255, 255, 255);
348                     }
349                     else
350                     {
351                         ImageObject.Color = value;
352                     }
353                 }
354                 _color = value;
355             }
356         }
357
358         /// <summary>
359         /// Sets the background color.
360         /// </summary>
361         /// <since_tizen> preview </since_tizen>
362         [Obsolete("This has been deprecated in API12")]
363         public override Color BackgroundColor
364         {
365             set
366             {
367                 if (value.IsDefault)
368                 {
369                     SetPartColor("bg", Color.Transparent);
370                 }
371                 else
372                 {
373                     SetPartColor("bg", value);
374                 }
375                 _backgroundColor = value;
376             }
377         }
378
379         /// <summary>
380         /// Gets the inlined image object of the image widget.
381         /// This property allows one to get the underlying EvasObject of type Image from this elementary widget. It can be useful to do things like save the image to a file, etc.
382         /// </summary>
383         /// <remarks>Be careful not to manipulate it, as it is under the control of the widget.</remarks>
384         /// <since_tizen> preview </since_tizen>
385         [Obsolete("This has been deprecated in API12")]
386         public EvasImage ImageObject
387         {
388             get
389             {
390                 if (_imageObject == null)
391                 {
392                     IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
393                     if (evasObj != IntPtr.Zero)
394                     {
395                         _imageObject = new EvasImage(this, evasObj);
396                         _imageObject.Deleted += (s, e) => _imageObject = null;
397                     }
398                 }
399                 return _imageObject;
400             }
401         }
402
403         /// <summary>
404         /// Sets the dimensions for an image object's border, a region which is not scaled together with its center ever.
405         /// </summary>
406         /// <param name="left">The border's left width.</param>
407         /// <param name="right">The border's right width.</param>
408         /// <param name="top">The border's top width.</param>
409         /// <param name="bottom">The border's bottom width.</param>
410         /// <since_tizen> preview </since_tizen>
411         [Obsolete("This has been deprecated in API12")]
412         public void SetBorder(int left, int right, int top, int bottom)
413         {
414             ImageObject?.SetBorder(left, right, top, bottom);
415         }
416
417         /// <summary>
418         /// Sets or gets if the center part of the given image object (not the border) should be drawn.
419         /// </summary>
420         /// <remarks>
421         /// When rendering, the image may be scaled to fit the size of the image object.
422         /// This function sets if the center part of the scaled image is to be drawn or left completely blank, or forced to be solid.
423         /// Very useful for frames and decorations.
424         /// </remarks>
425         /// <since_tizen> preview </since_tizen>
426         [Obsolete("This has been deprecated in API12")]
427         public ImageBorderFillMode BorderCenterFillMode
428         {
429             get
430             {
431                 if (ImageObject != null)
432                 {
433                     return ImageObject.BorderCenterFillMode;
434                 }
435                 else
436                 {
437                     return default(ImageBorderFillMode);
438                 }
439
440             }
441             set
442             {
443                 if (ImageObject != null)
444                 {
445                     ImageObject.BorderCenterFillMode = value;
446                 }
447             }
448         }
449
450         /// <summary>
451         /// Sets the file that is used as the image's source.
452         /// </summary>
453         /// <param name="file">The path to the file that is used as an image source.</param>
454         /// <returns>(true = success, false = error)</returns>
455         /// <since_tizen> preview </since_tizen>
456         [Obsolete("This has been deprecated in API12")]
457         public bool Load(string file)
458         {
459             if (file == null)
460                 throw new ArgumentNullException(nameof(file));
461
462             Interop.Elementary.elm_image_async_open_set(RealHandle, false);
463             Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true);
464             return Interop.Elementary.elm_image_file_set(RealHandle, file, null);
465         }
466
467         /// <summary>
468         /// Sets the URI that is used as the image's source.
469         /// </summary>
470         /// <param name="uri">The URI to the file that is used as an image source.</param>
471         /// <returns>(true = success, false = error)</returns>
472         /// <since_tizen> preview </since_tizen>
473         [Obsolete("This has been deprecated in API12")]
474         public bool Load(Uri uri)
475         {
476             if (uri == null)
477                 throw new ArgumentNullException(nameof(uri));
478
479             return Load(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri);
480         }
481
482         /// <summary>
483         /// Sets a location in the memory to be used as an image object's source bitmap.
484         /// </summary>
485         /// <remarks>
486         /// This function is handy when the contents of an image file are mapped into the memory, for example,
487         /// the format string should be something like "png", "jpg", "tga", "tiff", "bmp" etc, when provided (null, on the contrary).
488         /// This improves the loader performance as it tries the "correct" loader first, before trying a range of other possible loaders until one succeeds.
489         /// </remarks>
490         /// <param name="img">The binary data that is used as an image source.</param>
491         /// <param name="size">The size of the binary data blob img.</param>
492         /// <returns>(true = success, false = error)</returns>
493         /// <since_tizen> preview </since_tizen>
494         [Obsolete("This method will be removed. Use Load(Stream stream) instead.")]
495         public unsafe bool Load(byte* img, long size)
496         {
497             if (img == null)
498                 throw new ArgumentNullException(nameof(img));
499
500             Interop.Elementary.elm_image_async_open_set(RealHandle, false);
501             Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true);
502             return Interop.Elementary.elm_image_memfile_set(RealHandle, img, size, IntPtr.Zero, IntPtr.Zero);
503         }
504
505         /// <summary>
506         /// Sets the stream that is used as the image's source.
507         /// </summary>
508         /// <param name="stream">The stream that is used as an image source.</param>
509         /// <returns>(true = success, false = error)</returns>
510         /// <since_tizen> preview </since_tizen>
511         [Obsolete("This has been deprecated in API12")]
512         public bool Load(Stream stream)
513         {
514             if (stream == null)
515                 throw new ArgumentNullException(nameof(stream));
516
517             Interop.Elementary.elm_image_async_open_set(RealHandle, false);
518             Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true);
519             MemoryStream memstream = new MemoryStream();
520             stream.CopyTo(memstream);
521             unsafe
522             {
523                 byte[] dataArr = memstream.ToArray();
524                 fixed (byte* data = &dataArr[0])
525                 {
526                     return Interop.Elementary.elm_image_memfile_set(RealHandle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
527                 }
528             }
529         }
530
531         /// <summary>
532         /// Sets the file that is used as the image's source with async.
533         /// </summary>
534         /// <param name="file">The path to the file that is used as an image source.</param>
535         /// <param name="cancellationToken">The cancellation token.</param>
536         /// <returns>(true = success, false = error)</returns>
537         /// <since_tizen> preview </since_tizen>
538         [Obsolete("This has been deprecated in API12")]
539         public async Task<bool> LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken))
540         {
541             if (file == null)
542                 throw new ArgumentNullException(nameof(file));
543
544             Interop.Elementary.elm_image_async_open_set(RealHandle, true);
545             Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false);
546
547             var tcs = new TaskCompletionSource<bool>();
548
549             cancellationToken.Register(() =>
550             {
551                 if (tcs != null && !tcs.Task.IsCompleted)
552                 {
553                     tcs.SetCanceled();
554                 }
555             });
556
557             SmartEvent loadReady = new SmartEvent(this, RealHandle, "load,ready");
558             loadReady.On += (s, e) =>
559             {
560                 LoadingCompleted?.Invoke(this, EventArgs.Empty);
561                 if (tcs != null && !tcs.Task.IsCompleted)
562                 {
563                     tcs.SetResult(true);
564                 }
565             };
566
567             SmartEvent loadError = new SmartEvent(this, RealHandle, "load,error");
568             loadError.On += (s, e) =>
569             {
570                 LoadingFailed?.Invoke(this, EventArgs.Empty);
571                 if (tcs != null && !tcs.Task.IsCompleted)
572                 {
573                     tcs.SetResult(false);
574                 }
575             };
576
577             using (loadReady)
578             using (loadError)
579             {
580                 bool ret = Interop.Elementary.elm_image_file_set(RealHandle, file, null);
581                 if (!ret)
582                 {
583                     throw new InvalidOperationException("Failed to set file to Image");
584                 }
585                 // it should be return on main thread, because SmartEvent should be disposed on main thread
586                 return await tcs.Task.ConfigureAwait(true);
587             }
588         }
589
590         /// <summary>
591         /// Sets the URI that is used as the image's source with async.
592         /// </summary>
593         /// <param name="uri">The URI to the file that is used as an image source.</param>
594         /// <param name="cancellationToken">The cancellation token.</param>
595         /// <returns>(true = success, false = error)</returns>
596         /// <since_tizen> preview </since_tizen>
597         [Obsolete("This has been deprecated in API12")]
598         public Task<bool> LoadAsync(Uri uri, CancellationToken cancellationToken = default(CancellationToken))
599         {
600             if (uri == null)
601                 throw new ArgumentNullException(nameof(uri));
602
603             return LoadAsync(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri, cancellationToken);
604         }
605
606         /// <summary>
607         /// Sets the stream that is used as the image's source with async.
608         /// </summary>
609         /// <param name="stream">The stream that is used as an image source.</param>
610         /// <param name="cancellationToken">The cancellation token.</param>
611         /// <returns>(true = success, false = error)</returns>
612         /// <since_tizen> preview </since_tizen>
613         [Obsolete("This has been deprecated in API12")]
614         public async Task<bool> LoadAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
615         {
616             if (stream == null)
617                 throw new ArgumentNullException(nameof(stream));
618
619             Interop.Elementary.elm_image_async_open_set(RealHandle, true);
620             Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false);
621
622             var tcs = new TaskCompletionSource<bool>();
623
624             cancellationToken.Register(() =>
625             {
626                 if (tcs != null && !tcs.Task.IsCompleted)
627                 {
628                     tcs.SetCanceled();
629                 }
630             });
631
632             SmartEvent loadReady = new SmartEvent(this, RealHandle, "load,ready");
633             loadReady.On += (s, e) =>
634             {
635                 LoadingCompleted?.Invoke(this, EventArgs.Empty);
636                 if (tcs != null && !tcs.Task.IsCompleted)
637                 {
638                     tcs.SetResult(true);
639                 }
640             };
641
642             SmartEvent loadError = new SmartEvent(this, RealHandle, "load,error");
643             loadError.On += (s, e) =>
644             {
645                 LoadingFailed?.Invoke(this, EventArgs.Empty);
646                 if (tcs != null && !tcs.Task.IsCompleted)
647                 {
648                     tcs.SetResult(false);
649                 }
650             };
651
652             using (MemoryStream memstream = new MemoryStream())
653             using (loadReady)
654             using (loadError)
655             {
656                 await stream.CopyToAsync(memstream).ConfigureAwait(true);
657
658                 unsafe
659                 {
660                     byte[] dataArr = memstream.ToArray();
661                     fixed (byte* data = &dataArr[0])
662                     {
663                         bool ret = Interop.Elementary.elm_image_memfile_set(RealHandle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
664                         if (!ret)
665                         {
666                             return false;
667                         }
668                     }
669                 }
670                 // it should be return on main thread, because SmartEvent should be disposed on main thread
671                 return await tcs.Task.ConfigureAwait(true);
672             }
673         }
674
675         /// <summary>
676         /// Sets the color of the Color class for a given widget.
677         /// </summary>
678         /// <param name="part">The name of the Color class.</param>
679         /// <param name="color">The struct of the Color class.</param>
680         /// <since_tizen> preview </since_tizen>
681         [Obsolete("This has been deprecated in API12")]
682         public override void SetPartColor(string part, Color color)
683         {
684             Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255,
685                                                                               color.G * color.A / 255,
686                                                                               color.B * color.A / 255,
687                                                                               color.A);
688         }
689
690         /// <summary>
691         /// Gets the color of the Color class for a given widget.
692         /// </summary>
693         /// <param name="part">The name of the Color class.</param>
694         /// <returns>The color object.</returns>
695         /// <since_tizen> preview </since_tizen>
696         [Obsolete("This has been deprecated in API12")]
697         public override Color GetPartColor(string part)
698         {
699             Interop.Elementary.elm_object_color_class_color_get(Handle, part, out int r, out int g, out int b, out int a);
700             return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
701         }
702
703         /// <summary>
704         /// Sets the content at a part of a given container widget.
705         /// </summary>
706         /// <param name="parent">The parent is a given container, which will be attached by the image as a child. It's <see cref="EvasObject"/> type.</param>
707         /// <returns>The new object, otherwise null if it cannot be created.</returns>
708         /// <since_tizen> preview </since_tizen>
709         [Obsolete("This has been deprecated in API12")]
710         protected override IntPtr CreateHandle(EvasObject parent)
711         {
712             IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
713             Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default");
714
715             RealHandle = Interop.Elementary.elm_image_add(handle);
716             Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
717
718             return handle;
719         }
720     }
721
722     /// <summary>
723     /// Enumeration for the fill mode of the image border.
724     /// </summary>
725     /// <since_tizen> preview </since_tizen>
726     [Obsolete("This has been deprecated in API12")]
727     public enum ImageBorderFillMode
728     {
729         /// <summary>
730         /// None mode of the image border.
731         /// </summary>
732         None,
733
734         /// <summary>
735         /// Default mode of the image border.
736         /// </summary>
737         Default,
738
739         /// <summary>
740         /// Solid mode of the image border.
741         /// </summary>
742         Solid,
743     }
744
745     /// <summary>
746     /// Enumeration for the possible orientation options.
747     /// </summary>
748     /// <since_tizen> preview </since_tizen>
749     [Obsolete("This has been deprecated in API12")]
750     public enum ImageOrientation : int
751     {
752         /// <summary>
753         /// No orientation change.
754         /// </summary>
755         None = 0,
756
757         /// <summary>
758         /// Rotate 90 degrees clockwise.
759         /// </summary>
760         Rotate90,
761
762         /// <summary>
763         /// Rotate 180 degrees clockwise.
764         /// </summary>
765         Rotate180,
766
767         /// <summary>
768         /// Rotate 90 degrees counter-clockwise (i.e., 270 degrees clockwise).
769         /// </summary>
770         Rotate270,
771
772         /// <summary>
773         /// Flip the image horizontally.
774         /// </summary>
775         FlipHorizontal,
776
777         /// <summary>
778         /// Flip the image vertically.
779         /// </summary>
780         FlipVertical,
781
782         /// <summary>
783         /// Flip the image along the Y = (width - X) line (bottom-left to top-right).
784         /// </summary>
785         FlipTranspose,
786
787         /// <summary>
788         /// Flip the image along the Y = X line (top-left to bottom-right).
789         /// </summary>
790         FlipTransverse
791     }
792 }