Jump to content

imagecreate


pvtpyro

Recommended Posts

I made a script that creates an image. It makes the image just the way I want. comes out perfectly! but the [b]imagedestroy($image);[/b] prevents me from being able to save the image. As of now the file saves as a filename.php.gif, but it's not actually a gif.

is there a function or something I can use to save the actual image on my server, then show it in the browser for people to see?
Link to comment
Share on other sites

[quote author=Barand link=topic=106183.msg424489#msg424489 date=1156920191]
[code]<?php
imagecreate ($x, $y);

  // image code


imagegif($im, $path_filename);  // output to file
imagedestroy($im);
?>[/code]
[/quote]

using imagecreate can create a poor quality image
$image_p = imagecreatetruecolor($new_width, $new_height);

then
imagegif($image_p, $save_to, 75) //75 being the quality, i think 75 is a nice on
or
imagejpeg
or
imagepeng


Link to comment
Share on other sites

When you say create image, do u mean using other images, or adding lines ect

if using other images, here is code I use to blend images
[code]
<?php
$myimage = imagecreatefromjpeg("images/bground_img.jpg");
imagealphablending($map, 1);

$extra_img = imagecreatefromjpeg("second_img.jpg");
imagealphablending($extra_img, 1);

imagecopy($myimage, $extra_img, $x_loc, $y_loc, 0, 0, $width, $height);

imagejpeg($map, $save_to);
?>
[/code]


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.