summaryrefslogtreecommitdiff
path: root/html/examples/render_cd.lua
diff options
context:
space:
mode:
authorscuri <scuri>2009-06-26 17:14:56 +0000
committerscuri <scuri>2009-06-26 17:14:56 +0000
commit193cd3427108bd127e09f391f7fe51f6b62590e9 (patch)
tree7dfd83dec634c15f87f578266f6fdb0df046613a /html/examples/render_cd.lua
parent734afa90c3dda1232e9490d08346be4f2ffefec1 (diff)
*** empty log message ***
Diffstat (limited to 'html/examples/render_cd.lua')
-rw-r--r--html/examples/render_cd.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/html/examples/render_cd.lua b/html/examples/render_cd.lua
new file mode 100644
index 0000000..4af8a16
--- /dev/null
+++ b/html/examples/render_cd.lua
@@ -0,0 +1,19 @@
+require"imlua"
+require"cdlua"
+require"cdluaim"
+
+local image = im.ImageCreate(500, 500, im.RGB, im.BYTE)
+local canvas = image:cdCreateCanvas() -- Creates a CD_IMAGERGB canvas
+
+canvas:Activate()
+canvas:Background(cd.EncodeColor(255, 255, 255))
+canvas:Clear()
+fgcolor = cd.EncodeColor(255, 0, 0) -- red
+fgcolor = cd.EncodeAlpha(fgcolor, 50) -- semi transparent
+canvas:Foreground(fgcolor)
+canvas:Font("Times", cd.BOLD, 24)
+canvas:Text(100, 100, "Test")
+canvas:Line(0,0,100,100)
+canvas:Kill()
+
+image:Save("new.bmp", "BMP")