From 17b453cd0260de2112936efe717ccfc895939616 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Wed, 16 Nov 2016 01:31:39 -0800 Subject: [PATCH] doc: add more doc for imagewidget --- frontend/ui/widget/imagewidget.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/ui/widget/imagewidget.lua b/frontend/ui/widget/imagewidget.lua index 5e5d3ce0a..ae6bd890e 100644 --- a/frontend/ui/widget/imagewidget.lua +++ b/frontend/ui/widget/imagewidget.lua @@ -1,7 +1,7 @@ --[[-- -ImageWidget shows an image from a file +ImageWidget shows an image from a file or memory -Example: +Show image from file example: UIManager:show(ImageWidget:new{ file = "resources/info-i.png", @@ -9,6 +9,15 @@ Example: -- alpha = true, }) + +Show image from memory example: + + UIManager:show(ImageWidget:new{ + -- bitmap_buffer should be a block of memory that holds the raw + -- uncompressed bitmap. + image = bitmap_buffer, + }) + ]] local Widget = require("ui/widget/widget")