Get Pixel()

I can’t stress this enough: the lack of an ability to get the simple RGB value of a pixel is killing me in the market. Every other review complains because of the lack of this ability. (I don’t write games)
Every other shortcoming I have encountered with Corona I have worked around by ‘doing things another way’
But I’m totally brick walled by this.

I don’t care if the RGB value comes from the screen, from a file, from an in-memory picture, or from a function/library that gives me an array of pixel values from some input.

Any one of those, I can code around it.
But without the ability to get that RGB from ANYWHERE, I am handcuffed.

I don’t need speed. (I can apologise if what I need to do takes 5 minutes)
I don’t want to amend images on the fly mid-animation.
I don’t even need to amend the value afterwards. Just tell me what it is.

Please!!!
[import]uid: 108660 topic_id: 27469 reply_id: 327469[/import]

A very inefficient way but plausible way might be to capture the screen (display.save or display.captureScreen), save it as a .bmp file in temporary directory (Don’t think that’s possible, could be possible to beg Ansca for saving as different file types), open the file in binary mode (I’m certain Lua can do this, not certain about Corona), find for the 24 binary digits you’re looking for, close the file and interpret the binary digits. It may also be possible if you can translate a JPEG file’s binary data.

Hope this helps (even slightly).

EDIT: Sorry, forgot to double check my idea, lua can’t do what I suggested. Would be nice to see this functionality. [import]uid: 75643 topic_id: 27469 reply_id: 111642[/import]

I see you checked and found out for yourself, but:

>>A … plausible way might be to capture the screen… as a .bmp file<<

Corona can’t do that.

>> open the file in binary mode (I’m certain Lua can do this, not certain about Corona)<<

Lua can. Pretty sure Corona can.

>> It may also be possible if you can translate a JPEG file’s binary data.<<

That needs LZW compression libraries. Corona can’t do that.

I cant see anyone wanting save as BMP or DIB… these arent Mac-friendly formats.

I may have to dump all my code and start again from scratch with Xcode. That could take me a year.

n [import]uid: 108660 topic_id: 27469 reply_id: 111649[/import]