Jump to content

Where to find Canned PNG images


m august

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/15532-where-to-find-canned-png-images/
Share on other sites

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?
Maybe you are trying to create a new image to start on, are you?
In that circumstance you use [b]imagecreate[/b] 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.