Web Analytics Made Easy -
StatCounter question about "imagecreatetruecolor" - CodingForum

Announcement

Collapse
No announcement yet.

question about "imagecreatetruecolor"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • question about "imagecreatetruecolor"

    hello,

    I'm trying to turn a swf file into a jpeg.
    the swf movie works fine and when i click a button to call on a php page that converts it to a jpeg an error msg comes up saying that imagecreatetruecolor is not defined.
    I searched for a solution online and realized i should try to use imagecreate instead (something with GD support). it still gave me the same msg.
    i tried to add "@" before the action name and then the page came up w/o error but it was blank! no jpeg image of my swf.
    here is that part of the code:

    $image = @imagecreatetruecolor(300,200);
    $imagelines = @imagecreate(300,200);

    (as mentioned i tried it with and w/o the "@")
    in my code the imagecreatetruecolor appears black (like it doesn't recognize it) but the imagecreate is blue; nevertheless, the "not defined" error message still come up.

    what could it be?
    Thank you,

  • #2
    Re: question about "imagecreatetruecolor"

    I'm trying to turn a swf file into a jpeg.
    I didn't know that this was possible... ;-)
    But could be - i never did very much with SWFs.

    the swf movie works fine and when i click a button to call on a php page that converts it to a jpeg an error msg comes up saying that imagecreatetruecolor is not defined.
    It seems that you haven't GD support in your php installation.
    --> http://php.net/gd

    I searched for a solution online and realized i should try to use imagecreate instead (something with GD support). it still gave me the same msg.
    To use imagecreate you'll need GD support, too.

    --> http://php.net/imagecreate
    "We recommend the use of imagecreatetruecolor()."

    i tried to add "@" before the action name and then the page came up w/o error but it was blank! no jpeg image of my swf.
    Well... just read a little bit about php and you'll see that the only thing the '@' does is to supress the error messages.

    in my code the imagecreatetruecolor appears black (like it doesn't recognize it) but the imagecreate is blue; nevertheless, the "not defined" error message still come up.
    Which editor?
    Don't trust the syntax highlighting of your editor. If you haven't installed the needed librarys your php installation won't recognize the function, but good editors will highlight all known php functions, without caring about the extensions and libraries you have installed.

    Saludo
    piz
    www.united-scripts.com
    www.codebattles.org

    Comment


    • #3
      muchas gracias, Piz

      great comprehensive reply. I will check the GD support. I believe that's the problem.
      here is a good example of turning swf into jgeg

      http://snowflakes.lookandfeel.com/

      just FYI

      Comment


      • #4
        You're welcome ;-)

        Great SWF... thx for the link :-)
        www.united-scripts.com
        www.codebattles.org

        Comment

        Working...
        X