Jump to content


Photo

Where to find Canned PNG images


  • Please log in to reply
5 replies to this topic

#1 m august

m august
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 24 July 2006 - 07:37 PM

If one wants to use canned PNG images in ImageCreateFromPNG() functions, where does one find them? Are they already in the GD library somewhere? If I simply type in ImageCreateFromPNG('button.png'), for example, no such file is found. Do I have to copy such a dummy from somewhere into my own htdocs file? Where do I look for things like canned, unadorned button images?

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 24 July 2006 - 07:54 PM

I don't fully understand your definition of 'canned' images, but the function imagecreatefrompng() is used to create a new image, but starting with the canvas filled with the contents of an existing image, defined only parameter in the function.

#3 m august

m august
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 24 July 2006 - 08:27 PM

Exactly. That's what I'm referring to. I created my own button.php file in my htdocs directory. It is inside button.php that I call the ImageCreateFromPHP() function with argument 'button.png'. No, I do not have a button.png in my htdocs file, and the <image src= "button.php"> tag is in a separate, initial page in htdocs that does successfully invoke button.php which is also in htdocs. Naturally, my php error.log file says:


PHP Warning:  imagecreatefrompng(button.png)
[<a href='function.imagecreatefrompng'>function.imagecreatefrompng</a>]:
failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\button.php on line 3

I'm not surprised I got this message because I simply inserted the
ImageCreateFromPNG('button.png') call using an example from Lerdorf's 'Programming PHP' O'Reilly book, hoping that such a file might be in the GD libraries. I have T1Lib and FreeType and PNG support all enabled for GD. Surely there are dummy button images already sitting in the GD libraries - or somewhere. What path do I use to get to them?

#4 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 24 July 2006 - 09:03 PM

No, as far as I'm aware, there are no dummy/included images packaged with the GD library.

#5 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 24 July 2006 - 09:11 PM

Maybe you are trying to create a new image to start on, are you?
In that circumstance you use imagecreate with the width/height and then you only have to tell it what type it is when you output, such as:
imagepng,imagegif,imagejpg etc.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#6 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 25 July 2006 - 02:32 AM

do a google search for 'free button graphics'

I found this link right away:

http://www.freebutto...age=freebuttons

-if they are in some other graphics format like .jpg, just convert them to .png




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users