This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-04 17:40:38

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

PHP outputs image?

How do you get the php code to output an an image so that it can be put on a sig or something?

Like online things and stuff  hmm


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#2 2012-03-04 17:59:12

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: PHP outputs image?

YAY Documentation!

Edit:

Code:

$imghandle = imagecreatefrompng('http://somewebsite.co.uk/linktosomefile.png') //You can use imagecreatefrom[many types here].
header('Content-Type: image/png');//Tells the persons browser you are sending a png image.
imagepng($imghandle); //Echos the image to the page.
imagedestroy($imghandle); //Removes the processed image from memory

Last edited by rookwood101 (2012-03-04 18:04:47)


http://i.imgur.com/zeIZW.png

Offline

 

#3 2012-03-04 18:06:27

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: PHP outputs image?

rookwood101 wrote:

YAY Documentation!

Edit:

Code:

$imghandle = imagecreatefrompng('http://somewebsite.co.uk/linktosomefile.png') //You can use imagecreatefrom[many types here].
header('Content-Type: image/png');//Tells the persons browser you are sending a png image.
imagepng($imghandle); //Echos the image to the page.
imagedestroy($imghandle); //Removes the processed image from memory

That's really helpful!  big_smile


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#4 2012-03-04 18:08:21

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: PHP outputs image?

jji7skyline wrote:

rookwood101 wrote:

YAY Documentation!

Edit:

Code:

$imghandle = imagecreatefrompng('http://somewebsite.co.uk/linktosomefile.png') //You can use imagecreatefrom[many types here].
header('Content-Type: image/png');//Tells the persons browser you are sending a png image.
imagepng($imghandle); //Echos the image to the page.
imagedestroy($imghandle); //Removes the processed image from memory

That's really helpful!  big_smile

Your welcome  smile  There's loads of other stuff you can do, but I figure you can read  smile


http://i.imgur.com/zeIZW.png

Offline

 

#5 2012-03-04 18:46:53

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: PHP outputs image?

rookwood101 wrote:

jji7skyline wrote:

rookwood101 wrote:

YAY Documentation!

Edit:

Code:

$imghandle = imagecreatefrompng('http://somewebsite.co.uk/linktosomefile.png') //You can use imagecreatefrom[many types here].
header('Content-Type: image/png');//Tells the persons browser you are sending a png image.
imagepng($imghandle); //Echos the image to the page.
imagedestroy($imghandle); //Removes the processed image from memory

That's really helpful!  big_smile

Your welcome  smile  There's loads of other stuff you can do, but I figure you can read  smile

Thanks for the help  big_smile

I made this with it.


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

Board footer