We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › built in javascript methods for processing applet
Page Index Toggle Pages: 1
built in javascript methods for processing applet? (Read 652 times)
built in javascript methods for processing applet?
Sep 29th, 2006, 9:23pm
 
hello

i do artwork with physical computing using a web browser and (internet explorer) based javascript to drive serial ports, midi ports, and flash animaitions. (http://www.ifam.net/mikon/)

is it possible to have browser based javascript get the grayscale area within a portion of a processing applet window?  ie say i want to grab the greyscale value with four 2d coordinates in the applet window, is there a way to get these variables from javascript?

what i would like to do is something like this with browser based javascrip. i don't know whether processing has javascript methods accessible from a browser so i made up a couple for the sake of this illustration:


//"processingwindow"= processing applet object

//"getgreayvalueof(20, 20, 40, 40) would be a javascript
//method to get the

//greayscale values of the area in the processing applet

//window bounded by 20x and 20y units on the top left

//cornerof the field and 20x and 40y unites in the lower

//bottom corner of the applet.


function getgreayscale_values()


{
var grayscale= new Number():
processingwindow.getgreayvalueof(20, 20, 40, 40);
alert(grayscale);

}

so in this example the function would bring up an alert window with the grayscale average within the space specified in the (fictional) getgreayvalueof() method
thanks for whatever pointers anyone may have
Page Index Toggle Pages: 1