Get Pixel Color

Hi,

How to get the current mouse over pixel color using corona SDK.

I have loaded an image in the screen. it has various colors. i want to get the color code of the current mouse pointer/ Touch pixel.

Thanks in advance. [import]uid: 101698 topic_id: 19390 reply_id: 319390[/import]

You cannot grab pixel color. Sorry.

Peach [import]uid: 52491 topic_id: 19390 reply_id: 74871[/import]

Thanks for you quick response peach.

I am developing a Map learning app. Just mapping the country with the map outline. Each countries has s solid colored PNG images. i plan to check the pixel color and compare it to the country solid color.

Is there any alternate approach / API available to do this.

Thanks

Prasanna [import]uid: 101698 topic_id: 19390 reply_id: 74880[/import]

You could state the colors for each country png. Eg; australia.color = “peach” and then compare it to the outline color. (Which you’d also set a .color = “whatever” for).

Is that an option?

Peach :slight_smile: [import]uid: 52491 topic_id: 19390 reply_id: 74889[/import]

Hi,

The country images are PNG rectangle in shapes. The county outline has been filled with solid color. the remaining area of the rectangle in filled with clear color. So its not possible to compare with the Outline color.

Thanks.
Prasanna [import]uid: 101698 topic_id: 19390 reply_id: 74893[/import]

I’m not sure what your goal is, you mentioned comparing colors - and I believe that may be achieved by setting a .color = “whatever” property on each object you hope to compare to any other. [import]uid: 52491 topic_id: 19390 reply_id: 74998[/import]

I need the ability to get the RGB value of a pixel from a picture too.

In fact, having fruitlessly searched for this, I see I am far from alone: many people were hoping to use a bitmap as a way of defining tiled maps, for instance.

The API that allows for screen capture must have access to the RGB values of the screen display.
Any external libraries for it? [import]uid: 108660 topic_id: 19390 reply_id: 76562[/import]

Hey there, have you posted in feature requests?

Peach :slight_smile: [import]uid: 52491 topic_id: 19390 reply_id: 76849[/import]