SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    imagecopy problem?

    Heres the problem i have, ive created a graph and now need to put a little star on each change, im trying to use the imagecopy function but cant seem to get it working, heres the code i have:

    $image = imagecreatefromjpeg("my url");

    $mapimage = imagecreatefromjpeg("http://www.weightloss.co.uk/images/star.jpg");

    //Draw HEIGHT lines
    $height_x2 = $height_x1 + $xgap;
    $height_y2 = $ymax - ($row_restofid['meaHeight'] * 2.1);

    imageline($image, $height_x1, $height_y1, $height_x2, $height_y2, $height_linecolor);
    imagecopy($mapimage, $image, 0, 0, $height_x2, $height_y2, 10, 10);

    $height_x1 = $height_x2;
    $height_y1 = $height_y2;

    any ideas on what i need to do?
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Stupid question: Does is work with another "star" image? I tried to get it to try and do what you want, but the URL for the star seems to be incorrect...

    Anyway, I'll take a look at it and try with another file.

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)

  3. #3
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I tried that with other images...
    The way you do it right now is that the image is copied on the star, not the other way around (in imagecopy, the first image is the destination, the second one is the source). You should use
    PHP Code:
    imagecopy($image$mapimage00$height_x2$height_y21010); 
    As for the variables, they aren't all defined, so I had to hardcode the size, offset, etc... I assume that you didn't post the whole code...

    Hope that helps,

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)

  4. #4
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thx very much for the help, it is true, i didnt post the whole code . Yeh was getting a little confused which way round things went in the function, lol. Im using something else now anyways, thx for your time though
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  5. #5
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're very welcome!

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •