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 & HelpSyntax Questions › Importing Data from a webpage
Page Index Toggle Pages: 1
Importing Data from a webpage (Read 270 times)
Importing Data from a webpage
Jan 20th, 2009, 7:34am
 
I am trying to import data (such as an image) that has a web address and then embed this applet into its own webpage.

Look at the example at:

http://www.thevioletpiece.com/spore/processing/search/index.html

with the corresponding code:

void setup()
{
 noStroke();
 background(random(155));
 size(200, 200);
 PImage img1;
 img1 = loadImage("http://www.processing.org/img/processing_beta_cover.gif");
 image(img1, 0, 45);
}


this works fine when I run it on my own machine, but doesn't seem to work when I embed it in a webpage!

Any thoughts on how to solve this?
Re: Importing Data from a webpage
Reply #1 - Jan 20th, 2009, 10:20am
 
Same problem as for your XML loading (ie. applet must be signed to access data from another Web site). Since it is an image that should not change, you should just include the image in the data folder of your project, it will avoid "stealing" bandwidth from the Processing site... Smiley (and it will be always available, will load faster, etc.).
Page Index Toggle Pages: 1