The Daily Click ::. Forums ::. Klik Coding Help ::. pick the color of a pixel............
 

Post Reply  Post Oekaki 
 

Posted By Message

Dirty Sanchez



Registered
  17/06/2011
Points
  5
17th June, 2011 at 15:54:31 -

Hello guys

I want to make the following:

picking the rgb color of a specific pixel of the background and replacing the color of an active with this color.

I know the expression: "Get RGB at...." of an active object. With this you can pick the color of a pixel (x/y) of any active you want. But sadly there seems to be no function to pick the color of any pixel on the screen you want to, like x = 274 / y = 775

Any idea how to do this??

working with mmf2 dev by the way

many thx!!!!

your dirty

 
n/a

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
17th June, 2011 at 16:03:33 -

Maybe, when the user clicks the mouse, they set an Alterable Value or Global Value to a specific colour.

EDIT: or rather, each value relates to a specific colour. So clicking on a different colour changes the value, which changes the colour that's referenced. Apologies for my lack of clarity...

Then, when the user clicks on an active object, that object takes on the previously-selected colour.

Try that, and see if it works.

Edited by s-m-r

 
n/a

Dirty Sanchez



Registered
  17/06/2011
Points
  5
17th June, 2011 at 16:21:09 -

That will surely work but it is not exactly what i want like to do.

Its all about NOT pre-defining specific colors.

Let me give you an example: My background is colorful like a rainbow.

My active can now be moved over the background. When i hit a button, the actives color (or at least parts of it) should be replaced with the color of the backdrop. For this i have to find a way to PICK the color of the backdrop, store it in a value and transfer it to my active.

This IS possible from active to active because i found the right command. But i dont know how to do this from background to active......

 
n/a

nim



Registered
  17/05/2002
Points
  7234
17th June, 2011 at 16:26:31 -

If you don't mind using an extension, I recommend using Liji's excellent Pixel Object.

 
//

nim



Registered
  17/05/2002
Points
  7234
17th June, 2011 at 16:28:57 -

Extension: http://ext.neatwares.ath.cx/ext/Pixel_Object

Example mfa: http://www.box.net/shared/p019368m9yetxfignfgb

I spell "colour" the funny way, but apart from that I believe this does what you're looking for.

 
//
   

Post Reply



 



Advertisement

Worth A Click