I was wondering, is there any way in Corona/Lua to create a bitmap and save it?
It’s interesting, that in Codea on the iPad, which also uses LUA has an example of a bitmap drawing tool, and I wonder if that’s something that could also be done in Corona.
Essentially, I would like to great a grid to represent pixels and save the bitmap created to a file. [import]uid: 100618 topic_id: 26216 reply_id: 326216[/import]
Painfully.
This is an outstanding feature request.
It is possible now, but only with a horrible hack, and you are probably restricted to screen resolution.
How?
Create a display group.
Add to that display group a large newRect of the most common colour.
Then add more newRects, whose fill colour represents each pixel, and of a 1 x 1 pixel size.
When you are finished, your display group contains a representation of the image you want made up of rects.
You can do a display save of that display group, and it will create a PNG file
Im desperate for the reverse. I need to look at a pixel and know what colour it is. [import]uid: 108660 topic_id: 26216 reply_id: 106260[/import]
Wow, that’s one heck of a workaround…! I might give it a try. Thanks…
Too bad that it doesn’t have bitmap contexts to work with.
Hopefully it’ll get into a release sometime soon.
[import]uid: 100618 topic_id: 26216 reply_id: 106388[/import]