Jsui loading image files

Jun 29, 2011 at 6:44am

Jsui loading image files

how does one load image files into a jsui object? Could someone give me a coding example? I found some info here: http://cycling74.com/docs/max5/vignettes/js/jsimageobject.html

Sorry if this seems like a really simple question but I just can’t seem to get it to work.


Jun 29, 2011 at 7:46am

This is how it works:

// define your drawing context (canvas) as 2d

function draw(filename) {
	// a) contsructing the new image object with the filename
	var img = new Image(filename);

	// b) optionally: scale the image to a certain size

	// c) copy the pixels from the object to the drawing context

	// d)refresh the display of jsui

send the message [draw filename] to the jsui and the image will appear.


Jun 29, 2011 at 7:48am

By the way – jsui uses JavaScript not Java (just because the thread is in the Java forum). Similar name very different things…. ;)

Jun 30, 2011 at 3:22pm

moved to JavaScript forum…


You must be logged in to reply to this topic.