m august Posted July 24, 2006 Share Posted July 24, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/15532-where-to-find-canned-png-images/ Share on other sites More sharing options...
zq29 Posted July 24, 2006 Share Posted July 24, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/15532-where-to-find-canned-png-images/#findComment-63101 Share on other sites More sharing options...
m august Posted July 24, 2006 Author Share Posted July 24, 2006 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 3I'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? Quote Link to comment https://forums.phpfreaks.com/topic/15532-where-to-find-canned-png-images/#findComment-63122 Share on other sites More sharing options...
zq29 Posted July 24, 2006 Share Posted July 24, 2006 No, as far as I'm aware, there are no dummy/included images packaged with the GD library. Quote Link to comment https://forums.phpfreaks.com/topic/15532-where-to-find-canned-png-images/#findComment-63130 Share on other sites More sharing options...
ShogunWarrior Posted July 24, 2006 Share Posted July 24, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/15532-where-to-find-canned-png-images/#findComment-63132 Share on other sites More sharing options...
mainewoods Posted July 25, 2006 Share Posted July 25, 2006 do a google search for 'free button graphics'I found this link right away:http://www.freebuttons.com/index.php?page=freebuttons-if they are in some other graphics format like .jpg, just convert them to .png Quote Link to comment https://forums.phpfreaks.com/topic/15532-where-to-find-canned-png-images/#findComment-63217 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.