summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-03-26 04:33:04 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-03-26 04:36:50 (GMT)
commit09a40e13174b9f34007ce9fbd98e06b4e48c1954 (patch)
tree8f7735640e87e154d434f80130ab8812e3f4e58b /examples/declarative
parentc2928bfdb467d7c54a97a71b6a1169db02e623fe (diff)
downloadQt-09a40e13174b9f34007ce9fbd98e06b4e48c1954.zip
Qt-09a40e13174b9f34007ce9fbd98e06b4e48c1954.tar.gz
Qt-09a40e13174b9f34007ce9fbd98e06b4e48c1954.tar.bz2
Control of image rendered size (esp. SVG).
Add Translate transform. Image::sourceWidth and Image::sourceHeight read/write properties. Task-number: QTBUG-8984
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/images/content/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/images/images.qml70
2 files changed, 70 insertions, 0 deletions
diff --git a/examples/declarative/images/content/lemonade.jpg b/examples/declarative/images/content/lemonade.jpg
new file mode 100644
index 0000000..db445c9
--- /dev/null
+++ b/examples/declarative/images/content/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/images/images.qml b/examples/declarative/images/images.qml
new file mode 100644
index 0000000..82848df
--- /dev/null
+++ b/examples/declarative/images/images.qml
@@ -0,0 +1,70 @@
+import Qt 4.6
+
+Rectangle {
+ color: "white"
+ width: grid.width + 50
+ height: grid.height + 50
+
+ Grid {
+ x: 25; y: 25
+ id: grid
+ columns: 3
+
+ Image {
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ sourceWidth: 50
+ sourceHeight: 50
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ sourceWidth: 50
+ sourceHeight: 50
+ smooth: true
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ scale: 1/3
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ scale: 1/3
+ sourceWidth: 50
+ sourceHeight: 50
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ scale: 1/3
+ sourceWidth: 50
+ sourceHeight: 50
+ smooth: true
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ width: 50; height: 50; transform: Translate { x: 50 }
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ width: 50; height: 50; transform: Translate { x: 50 }
+ sourceWidth: 50
+ sourceHeight: 50
+ source: "content/lemonade.jpg"
+ }
+
+ Image {
+ width: 50; height: 50; transform: Translate { x: 50 }
+ sourceWidth: 50
+ sourceHeight: 50
+ smooth: true
+ source: "content/lemonade.jpg"
+ }
+ }
+}