Hey guys,

I want to know how I can add different border "styles" around an image.
Here's what I do to create an image:

function output_new_img () {

    $new = $this->calc_new_size ($this->max_w, $this->max_h);
    $new_w = $new[0];
    $new_h = $new[1];

    $src_img = ImageCreateFromJPEG ($this->temp_img);
    $dst_img = ImageCreateTrueColor ($new_w, $new_h);
    ImageCopyResampled ($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h,
ImageSX($src_img), ImageSY($src_img));

    if (ImageJPEG($dst_img, $this->dst_path . $this->img_name, 95)) {
        return true;
    }
}

Now, what I want to do is draw a border style around that certain image. The
border can be different widths. It can either be created outside the borders
of the image, or on the inside of the borders of the image, I need to have
it both ways. Since this is a .jpg file being created, I want to do this
"while" I'm creating this image before it saves it to file. The reason for
this is that a *.jpg image compresses itself each time it is saved, which
results in poor quality the more you change it and save it.

Now to the question. Which combinations of image functions do I need to
achieve this goal? And how will each of these functions help me. For
example, will a certain function overlap a border style on top of the image
itself? Or does a certain function just draw lines around the image. Just
need an explaination of why I must use a certain function that any of you
would recommend. I think maybe Jason Wong would be a good candidate to
answer this one for me. He's good at pointing out references. I just need a
starting point and some suggestions on the different ways to achieve my
goal.

Thanks guys...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to