Is it possible to take a picture with the camera in Corona, then detect the RGB of a pixel at an X/Y location in that photo? [import]uid: 85633 topic_id: 17426 reply_id: 317426[/import]
I don’t understand, this looks like a way to add text to a photo? [import]uid: 85633 topic_id: 17426 reply_id: 66005[/import]
I’m not sure about the RGB, but what you could do is add this function:
[lua]local position = display.newText(“0,0”, _W/2,0, “Helvetica”, 60)
local function findPos(e)
position.text = (e.x) … “,” … (e.y)
end
Runtime:addEventListener(“touch”, findPos)[/lua]
hope it works.
Good luck,
J.K. [import]uid: 66117 topic_id: 17426 reply_id: 66003[/import]
Well, yea. This would only be used so you can find a spot on the screen. If you have an image where you want it, you would tap on the image and it would show you the x and y of where you tapped. It wouldn’t be used in the game, it would just be a help to you in making the app. So you wouldn’t have to do any guessing as to where you wanted another object. Sorry if it’s not what you needed.
P.S. i updated the code [import]uid: 66117 topic_id: 17426 reply_id: 66011[/import]
Hello Joe Kool,
I think you want the RGB values of a color in the photo.
If so if yhou have photo shop, load the photo, and click on the eye dropper and then click on the spot of color you want a value for, this will display the RGB values for this oolor.
Is this what you are looking for?
Ed [import]uid: 8102 topic_id: 17426 reply_id: 66016[/import]
Joe Kool, I see what you mean, that’s a work-around for getting an X/Y.
Basically, what I’ll be trying to do is, take a photo in the app, then I might want to look at all the pixels in the top 30% of the image and see if they are mostly blue, or gray to identify it as sky - just as an example.
So I need to take a photo, open the photo, look at pixel at point (10,20) and see it’s RBG value - all from within the app.
[import]uid: 85633 topic_id: 17426 reply_id: 66020[/import]
You can’t do that at present i’m afraid [import]uid: 84637 topic_id: 17426 reply_id: 66058[/import]
Can I do this right now?
Im with a problem EXACTLY with this “feature”: A need to select a color in a Image taken from the camera…
Any news? [import]uid: 9133 topic_id: 17426 reply_id: 66083[/import]
As I just said, this is not possible at the present time. [import]uid: 84637 topic_id: 17426 reply_id: 66085[/import]
Im sorry Dany! I asked but just read the DATE in wrong way. I thought the reply date was July, not November. I read backwards. Sorry!
Just happen! LOL! [import]uid: 9133 topic_id: 17426 reply_id: 66087[/import]
@bsdrago, that is one point of difference between the world, I have worked in laces where they use 3 decimal places, that was a bit of a surprise and shock as most commercial enterprise software assume that the world uses 2 decimal places only.
Then we have the Dates, the US method is MM-DD-YY, the UK/AU is DD-MM-YY, some parts of the world use YYYY-MM-DD and so on…
It is sometimes strange when people say oh it’s 70?, I have experienced 50? which was unbearable, only to then realise that the Americans are talking in ?F where as I was referring to 50?C which would have been 122?F and the 72?F was about 22-25?C which is the normal average temperature here in FNQ.
cheers,
?
[import]uid: 3826 topic_id: 17426 reply_id: 66204[/import]