aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-04-12 13:41:05 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-04-12 13:41:05 +0200
commite9f07ff5373e744bf0fe71baa6809641e55531e7 (patch)
tree095beb54f96ee0dd13ee3de506d7e28363f508fd /examples
parentNew 1.14 function: Elm.Transit.go_in() (diff)
downloadpython-efl-e9f07ff5373e744bf0fe71baa6809641e55531e7.tar.gz
New 1.14 API: elm.Photocam.image_orient
with test. NOTE: playing with the test reveal lots of image_orient errors
Diffstat (limited to 'examples')
-rw-r--r--examples/elementary/test_photocam.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/examples/elementary/test_photocam.py b/examples/elementary/test_photocam.py
index ee9d589..1eac672 100644
--- a/examples/elementary/test_photocam.py
+++ b/examples/elementary/test_photocam.py
@@ -1,7 +1,10 @@
#!/usr/bin/env python
# encoding: utf-8
-from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EXPAND_BOTH, FILL_BOTH
+from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EXPAND_BOTH, FILL_BOTH, \
+ EVAS_IMAGE_ORIENT_0, EVAS_IMAGE_ORIENT_90, EVAS_IMAGE_ORIENT_180, \
+ EVAS_IMAGE_ORIENT_270, EVAS_IMAGE_FLIP_HORIZONTAL, EVAS_IMAGE_FLIP_VERTICAL, \
+ EVAS_IMAGE_FLIP_TRANSPOSE, EVAS_IMAGE_FLIP_TRANSVERSE
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
@@ -50,6 +53,10 @@ def _cb_pc_download_error(im, info, pb):
pb.hide()
+def _cb_orient(btn, pc, orient):
+ pc.image_orient = orient
+
+
def photocam_clicked(obj):
win = StandardWindow("photocam", "Photocam test", autodel=True,
size=(600, 600))
@@ -118,6 +125,28 @@ def photocam_clicked(obj):
tb.pack(bt, 2, 2, 1, 1)
bt.show()
+ # Orient buttons
+ box = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
+ tb.pack(box, 0, 1, 1, 1)
+ box.show()
+
+ orients = [
+ (EVAS_IMAGE_ORIENT_0, "Orient 0"),
+ (EVAS_IMAGE_ORIENT_90, "Orient 90"),
+ (EVAS_IMAGE_ORIENT_180, "Orient 180"),
+ (EVAS_IMAGE_ORIENT_270, "Orient 270"),
+ (EVAS_IMAGE_FLIP_HORIZONTAL, "Flip Horiz"),
+ (EVAS_IMAGE_FLIP_VERTICAL, "Flip Vert"),
+ (EVAS_IMAGE_FLIP_TRANSPOSE, "Transpose"),
+ (EVAS_IMAGE_FLIP_TRANSVERSE, "Transverse"),
+ ]
+
+ for val, label in orients:
+ bt = Button(win, text=label, size_hint_align=(0.1, 0.5))
+ bt.callback_clicked_add(_cb_orient, pc, val)
+ box.pack_end(bt)
+ bt.show()
+
# show the win
win.show()