mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
more js mode examples: user and file input
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* <form><input type="file" id="file-input"/></form>
|
||||
*
|
||||
* No Safari support.
|
||||
*/
|
||||
|
||||
PImage img = null;
|
||||
|
||||
void setup ()
|
||||
{
|
||||
size(300, 200);
|
||||
}
|
||||
|
||||
void draw ()
|
||||
{
|
||||
background(255);
|
||||
if ( img != null ) image(img, 0,0, width,height);
|
||||
}
|
||||
|
||||
void newImageAvailable ( Image i )
|
||||
{
|
||||
img = new PImage( i );
|
||||
}
|
||||
Reference in New Issue
Block a user