Cairo__Examples1.st
changeset 51 5293f2b851ab
parent 50 239120c68187
child 53 57718b3ac316
--- a/Cairo__Examples1.st	Thu Feb 25 20:55:41 2016 +0000
+++ b/Cairo__Examples1.st	Sun Feb 28 14:53:56 2016 +0000
@@ -53,6 +53,25 @@
 cr stroke.
 
     "Created: / 26-02-2016 / 21:53:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+example21: cr <example: '21 - Display PNG from file'>
+| png |
+
+png := Cairo::Surface newPNGWithFile: (Smalltalk getBitmapFileName:'circle1.png' forPackage:#'stx:goodies/libcairo') pathName.
+
+cr sourceR: 1 G: 1 B: 1.
+cr rectangleX: 0 y: 0 width: 32 height: 32.
+cr fill.
+
+cr sourceR: 0 G: 0 B: 0.
+cr rectangleX: 32 y: 32 width: 32 height: 32.
+cr fill.
+
+cr sourceSurface: png x: 0 y: 0.
+cr paint.
+
+    "Created: / 28-02-2016 / 07:56:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !Examples1 methodsFor:'private'!