https://wiki.gideros.rocks/index.php?title=Media_Plugin&feed=atom&action=history
Media Plugin - Revision history
2024-03-28T18:58:58Z
Revision history for this page on the wiki
MediaWiki 1.35.11
https://wiki.gideros.rocks/index.php?title=Media_Plugin&diff=23071&oldid=prev
MoKaLux at 21:42, 18 November 2023
2023-11-18T21:42:28Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 21:42, 18 November 2023</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l263" >Line 263:</td>
<td colspan="2" class="diff-lineno">Line 263:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></syntaxhighlight></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></syntaxhighlight></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{<del class="diffchange diffchange-inline">Welcome!</del>}}</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{<ins class="diffchange diffchange-inline">GIDEROS IMPORTANT LINKS</ins>}}</div></td></tr>
</table>
MoKaLux
https://wiki.gideros.rocks/index.php?title=Media_Plugin&diff=21515&oldid=prev
Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"
2023-07-13T13:30:59Z
<p>Text replacement - "</source>" to "</syntaxhighlight>"</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 13:30, 13 July 2023</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l261" >Line 261:</td>
<td colspan="2" class="diff-lineno">Line 261:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div></<del class="diffchange diffchange-inline">source</del>></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></<ins class="diffchange diffchange-inline">syntaxhighlight</ins>></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Welcome!}}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Welcome!}}</div></td></tr>
</table>
Hgy29
https://wiki.gideros.rocks/index.php?title=Media_Plugin&diff=20743&oldid=prev
Hgy29: Text replacement - "<source" to "<syntaxhighlight"
2023-07-13T13:28:39Z
<p>Text replacement - "<source" to "<syntaxhighlight"</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 13:28, 13 July 2023</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l7" >Line 7:</td>
<td colspan="2" class="diff-lineno">Line 7:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== A Complete Example ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== A Complete Example ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''It's rough but you have it all'''</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''It's rough but you have it all'''</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><<del class="diffchange diffchange-inline">source </del>lang="lua"></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><<ins class="diffchange diffchange-inline">syntaxhighlight </ins>lang="lua"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>--require plugin</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>--require plugin</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>require "media"</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>require "media"</div></td></tr>
</table>
Hgy29
https://wiki.gideros.rocks/index.php?title=Media_Plugin&diff=17594&oldid=prev
MoKaLux at 00:13, 19 March 2021
2021-03-19T00:13:08Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 00:13, 19 March 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>__TOC__</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>__TOC__</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Here you will find various resources to help you use Gideros <del class="diffchange diffchange-inline">Plugins</del>.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Here you will find various resources to help you use Gideros <ins class="diffchange diffchange-inline">'''Media''' plugin</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''note''': <del class="diffchange diffchange-inline">You </del>may have to provide your own assets (fonts, gfx, …)<del class="diffchange diffchange-inline">.</del></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''note''': <ins class="diffchange diffchange-inline">you </ins>may have to provide your own assets (fonts, gfx, …)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== A Complete Example ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== A Complete Example ===</div></td></tr>
</table>
MoKaLux
https://wiki.gideros.rocks/index.php?title=Media_Plugin&diff=17329&oldid=prev
MoKaLux: Created page with "__TOC__ Here you will find various resources to help you use Gideros Plugins. '''note''': You may have to provide your own assets (fonts, gfx, …). === A Complete Example..."
2020-12-23T00:56:59Z
<p>Created page with "__TOC__ Here you will find various resources to help you use Gideros Plugins. '''note''': You may have to provide your own assets (fonts, gfx, …). === A Complete Example..."</p>
<p><b>New page</b></p><div>__TOC__<br />
<br />
Here you will find various resources to help you use Gideros Plugins.<br />
<br />
'''note''': You may have to provide your own assets (fonts, gfx, …).<br />
<br />
=== A Complete Example ===<br />
'''It's rough but you have it all'''<br />
<source lang="lua"><br />
--require plugin<br />
require "media"<br />
<br />
local myappwidth = application:getContentWidth()<br />
local myappheight = application:getContentHeight()<br />
local mycallback = 0<br />
local bmp<br />
<br />
--just a function to create text button<br />
function createText(str, y, callback)<br />
local text = TextField.new(nil, str)<br />
text:setAnchorPoint(0.5, 0.5)<br />
text:setScale(5, 5)<br />
text:setPosition(1.75 * myappwidth / 4, y)<br />
stage:addChild(text)<br />
<br />
text:addEventListener(Event.MOUSE_DOWN, function(self, e)<br />
if self:hitTestPoint(e.x, e.y) then<br />
callback()<br />
end<br />
end, text)<br />
end<br />
<br />
-- create our "menu"<br />
createText("Check camera", 1 * 64, function() -- WORKS<br />
print("CHECK CAMERA") -- NO CALLBACK<br />
mycallback = 1<br />
print(mediamanager:isCameraAvailable())<br />
end)<br />
<br />
createText("Take picture", 2.1 * 64, function() -- WORKS ONLY THUMBNAIL!<br />
print("TAKE PICTURE WITH CAMERA")<br />
mycallback = 2<br />
mediamanager:takePicture()<br />
end)<br />
<br />
createText("Take thumbnail", 3.1 * 64, function() -- WORKS<br />
print("MAKE THUMBNAIL FROM CAMERA")<br />
mycallback = 3<br />
mediamanager:takePicture()<br />
end)<br />
<br />
createText("Take screenshot", 4.1 * 64, function() -- WORKS NO PERMISSIONS NEEDED BUT SAVE TO GIDEROS APP FOLDER<br />
print("SCREENSHOT")<br />
mycallback = 4<br />
mediamanager:takeScreenshot()<br />
end)<br />
<br />
createText("Get picture", 5.1 * 64, function() -- WORKS NEED PERMISSIONS READ<br />
print("GET PICTURE")<br />
mycallback = 5<br />
mediamanager:getPicture()<br />
end)<br />
<br />
createText("Save picture", 6.1 * 64, function() -- WORKS NEED PERMISSIONS WRITE<br />
print("SAVE PICTURE")<br />
mycallback = 6<br />
-- draw your gfx (here I draw a simple pixel)<br />
local source = Pixel.new(0xffff00, 0.75, 128, 128)<br />
-- create a render target and draw to it<br />
local rt = RenderTarget.new(source:getWidth(), source:getHeight())<br />
rt:draw(source)<br />
-- save your render target to gideros documents folder<br />
local myfilepath = "|D|mysavedpicture2.png"<br />
rt:save(myfilepath)<br />
-- create a new media and save your gfx<br />
-- android saved path = internal storage/pictures<br />
-- NEED permission write external storage<br />
local media = Media.new(myfilepath)<br />
mediamanager:postPicture(myfilepath)<br />
<br />
-- show your gfx on stage<br />
if bmp then -- remove previous Bitmap<br />
bmp:removeFromParent()<br />
bmp = nil<br />
end<br />
bmp = Bitmap.new(rt, true)<br />
bmp:setPosition(0, myappheight - bmp:getHeight())<br />
stage:addChildAt(bmp, 1)<br />
end)<br />
<br />
createText("Play Video", 7.1 * 64, function() -- WORKS?<br />
print("PLAY VIDEO")<br />
mycallback = 7<br />
mediamanager:playVideo("videos/test.mp4", false)<br />
<br />
--[[<br />
pheora=require "Theora"<br />
local videoSource=pheora.new("videos/file_example_OGG_480_1_7mg.ogg")<br />
local videoStream=videoSource:play()<br />
local videoSprite=videoStream:getVideo()<br />
videoSprite:setPosition(0, 64)<br />
stage:addChild(videoSprite)<br />
]]<br />
end)<br />
<br />
-- EVENT LISTENERS<br />
mediamanager:addEventListener(Event.MEDIA_RECEIVE, function(e)<br />
print("mycallback:", mycallback)<br />
<br />
local path = ""<br />
<br />
if mycallback == 1 then -- is camera available?<br />
-- nothing here<br />
<br />
elseif mycallback == 2 then -- take picture (thumbnail)<br />
local media = Media.new(e.path)<br />
path = media:getPath()<br />
if bmp then -- remove previous Bitmap<br />
bmp:removeFromParent()<br />
bmp = nil<br />
end<br />
bmp = Bitmap.new(Texture.new(path, true))<br />
bmp:setPosition(0, myappheight - bmp:getHeight())<br />
stage:addChildAt(bmp, 1)<br />
<br />
elseif mycallback == 3 then -- make thumbnail<br />
local media = Media.new(e.path)<br />
path = media:getPath()<br />
if bmp then -- remove previous Bitmap<br />
bmp:removeFromParent()<br />
bmp = nil<br />
end<br />
bmp = Bitmap.new(Texture.new(path, true))<br />
bmp:setPosition(0, myappheight - bmp:getHeight())<br />
stage:addChildAt(bmp, 1)<br />
<br />
elseif mycallback == 4 then -- take screenshot and save<br />
local media = Media.new(e.path)<br />
media:resize(myappwidth / 2, myappheight / 2, true)<br />
media:save()<br />
-- print("media size", media:getWidth(), media:getHeight())<br />
path = media:getPath()<br />
if bmp then -- remove previous Bitmap<br />
bmp:removeFromParent()<br />
bmp = nil<br />
end<br />
bmp = Bitmap.new(Texture.new(path, true))<br />
bmp:setPosition(0, myappheight - bmp:getHeight())<br />
stage:addChildAt(bmp, 1)<br />
<br />
elseif mycallback == 5 then -- get picture from file explorer / gallery<br />
local media = Media.new(e.path)<br />
media:resize(myappwidth / 2, myappheight / 2, true)<br />
media:save()<br />
path = media:getPath()<br />
if bmp then -- remove previous Bitmap<br />
bmp:removeFromParent()<br />
bmp = nil<br />
end<br />
bmp = Bitmap.new(Texture.new(path, true))<br />
bmp:setPosition(0, myappheight - bmp:getHeight())<br />
stage:addChildAt(bmp, 1)<br />
<br />
elseif mycallback == 6 then -- save picture to file / gallery<br />
-- nothing here<br />
<br />
elseif mycallback == 7 then -- play video<br />
-- nothing here<br />
<br />
else<br />
-- nothing here<br />
end<br />
end)<br />
<br />
--user canceled selecting image<br />
mediamanager:addEventListener(Event.MEDIA_CANCEL, function()<br />
print("User cancelled media input")<br />
end)<br />
<br />
-------------------------------------------------------------------------------<br />
-------------------------------------------------------------------------------<br />
--[[<br />
-- FLOOD FILL<br />
local text = TextField.new(nil, "Click on ball to floodFill it")<br />
text:setScale(2)<br />
text:setPosition(100, 50)<br />
stage:addChild(text)<br />
<br />
--delete previos copy (path = .../Local/Temp/gideros/Media/documents/ball.png)<br />
local media = Media.new("gfx/ball.png")<br />
--print(media:getPath())<br />
mediamanager:deleteFile(media:getPath())<br />
<br />
-- create a new media from our image path<br />
local media = Media.new("gfx/ball.png")<br />
media:resize(256, 256, false)<br />
media:save()<br />
local bmp = Bitmap.new(Texture.new(media:getPath(), true))<br />
bmp:setPosition(256, 320)<br />
stage:addChild(bmp)<br />
<br />
stage:addEventListener(Event.MOUSE_DOWN, function(e)<br />
if bmp:hitTestPoint(e.x, e.y) then<br />
print("flood")<br />
-- media:floodFill(e.x, e.y, 0xff0000, 0.5, 100, true)<br />
-- media:floodFill(e.x, e.y, 0xffff00, 1, 8, true)<br />
media:floodFill(e.x, e.y, 0xffff00, 1, 8, false)<br />
media:save()<br />
print(media:getPath()) -- where on android?<br />
bmp:removeFromParent()<br />
bmp = Bitmap.new(Texture.new(media:getPath(), true))<br />
-- bmp:setPosition(256, 320)<br />
stage:addChild(bmp)<br />
end<br />
end)<br />
]]<br />
<br />
-------------------------------------------------------------------------------<br />
-------------------------------------------------------------------------------<br />
--[[<br />
-- EVENT LISTENERS<br />
mediamanager:addEventListener(Event.MEDIA_RECEIVE, function(e)<br />
<br />
print("callback")<br />
<br />
--print path<br />
print("path 01: "..e.path)<br />
<br />
local path = ""<br />
<br />
local media = Media.new(e.path)<br />
print("media sizes", media:getWidth(), media:getHeight())<br />
media:flipVertical()<br />
media:flipHorizontal()<br />
media:trim(0xffffff)<br />
media:drawText(8, 8, "Test Text", 0xff0000, 32)<br />
media:drawLine(4, 4, 16, 16, 0xff0000)<br />
media:resize(200, 200, false)<br />
print(media:getPixel(1, 1))<br />
for x = 50, 100 do<br />
for y = 50, 100 do<br />
media:setPixel(x, y, 255, 0, 0, 0.5) -- change color to semi transparent red<br />
end<br />
end<br />
media:drawImage(100, 100, "gfx/ball.png")<br />
media:save()<br />
path = media:getPath()<br />
print("path 02: "..path)<br />
<br />
--remove previous Bitmap<br />
if bmp then<br />
bmp:removeFromParent()<br />
bmp = nil<br />
end<br />
<br />
--add selected image to the stage<br />
bmp = Bitmap.new(Texture.new(path, true))<br />
bmp:setPosition(10, 10)<br />
stage:addChildAt(bmp, 1)<br />
application:setBackgroundColor(0xff0000)<br />
end)<br />
]]<br />
</source><br />
<br />
{{Welcome!}}</div>
MoKaLux