I need to do something like what is described here
http://stackoverflow.com/questions/2297913/determine-how-much-space-is-left-on-a-drawing-application
in Lua.
Any ideas? [import]uid: 4416 topic_id: 1410 reply_id: 301410[/import]
I need to do something like what is described here
http://stackoverflow.com/questions/2297913/determine-how-much-space-is-left-on-a-drawing-application
in Lua.
Any ideas? [import]uid: 4416 topic_id: 1410 reply_id: 301410[/import]
There is currently no way to access the stage or an object “pixelwise”…
So the only thing you could do is using an alternative form of data storage for where pixels are set or not and “paint” into that in parallel.
If you develop for iPhone it may be ok to use a string of 320x480 (150 k) characters or maybe a table as big … that would eat a lot of memory… It may be slow and I did not tested it if the device can handle it at all.
Depending on the brush size and its stepping cheat by having it always move to the nearest 8x8 pixel cell. This would cut down the storage size needed.
The other way would be some vector “drawing” based stuff… having objects which join each other into bigger ones when they overlap… that is also a pretty advance technique. Basically you would check for an object which has all its points on the border (or outside) of the drawing area and covers all 4 corners too (point in vector object check). [import]uid: 6928 topic_id: 1410 reply_id: 3903[/import]
Sorry for the necropost-- I’m just following up on this idea. In the intervening months, has Ansca added a means of querying pixel values of a raster at arbitrary coordinates in the image? [import]uid: 13204 topic_id: 1410 reply_id: 16747[/import]