VS: Colour of a pixel?

Sakari sakari.ruoho at academica.com
Thu Jul 13 01:16:01 EDT 2006


How about putting this into image's script?

local xCoord
local YCoord

on mouseMove
  put (first item of(the mouseLoc)- first item of (the topLeft of me))+1
into xCoord
  put (last item of(the mouseLoc)- last item of (the topLeft of me))+1 into
yCoord
  put xCoord & "," & yCoord into field "info"
end mouseMove

on mouseDown
  put the imageData of me into tData
  --  put binaryEncode("C",0) into tPixel
  --  put tPixel into char((xCoord*yCoord)*4) of tData
  --set the imageData of me to tData
  repeat with x=2 to 4
    if x <> 4 then
      put chartonum(char((xCoord*yCoord)*x) of tData)&"," after tColor
    else
      put chartonum(char((xCoord*yCoord)*x) of tData) after tColor
    end if
  end repeat
  put tColor into field "info2"
end mouseDown

I have been doing this for couple weeks(rev I mean) so I might be mistaken.

Sakari

-----Alkuperäinen viesti-----
Lähettäjä: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] Puolesta John Tregea
Lähetetty: 13. heinäkuuta 2006 4:36
Vastaanottaja: How to use Revolution
Aihe: Colour of a pixel?

Hi again,

Can anyone tell me if there is a way of getting the rgb value of a 
specified pixel within a jpg graphic file that has been imported into rev?

I have read the docs but cannot see anything that tells me if I can or 
how...

Regards

John T
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list