Re: help with framing a pic
- From: Geoff Berrow <blthecat@xxxxxxxxxxx>
- Date: Fri, 24 Jun 2005 19:12:32 +0100
I noticed that Message-ID: <d9gupo$7mh$1@xxxxxxxxxxxxxx> from Ashok
contained the following:
>In short, something like www.framenview.com but not so complex. Just the
>picture and frames, and on selecting the frame thumbnail, picture gets
>framed.
My dropshadow function effectively puts a frame on two sides
www.ckdog.co.uk/phdropshad/
Extending that a bit gives you framing
www.ckdog.co.uk/phdropshad/corners.php
You need to create 8 images for the frame, thought this is really two
images rotated. You have 4 corners and 4 sides Call the function like
so ds(path to image, frame width, alt text) to display the framed
image. And it does it with divs, not tables.
Code follows:
<?php
//define paths to border images
define("BOT","images/bot.gif");
define("TOP","images/top.gif");
define("LEFT","images/left.gif");
define("RIGHT","images/right.gif");
define("TOP_LEFT","images/tl.gif");
define("TOP_RIGHT","images/tr.gif");
define("BOT_RIGHT","images/br.gif");
define("BOT_LEFT","images/bl.gif");
function ds($image,$dsw,$alt){
//first check that file exists
if(file_exists($image)){
//create an image from the file
$img=ImageCreateFromJpeg($image);
//print containing <div> using image width plus shadow width
print "<div style='width:
".(imagesx($img)+$dsw+$dsw)."px;margin:0px'>\n";
//print topleftcorner
print "<img style='float: left;' src='".TOP_LEFT."'
height='$dsw' width='$dsw'alt='$alt'>\n";
//print topline
print "<img style='float: left;' src='".TOP."' height='$dsw'
width='".imagesx($img)."'alt='$alt'>\n";
//print toprightcorner
print "<img style='float: left;' src='".TOP_RIGHT."'
height='$dsw' width='$dsw'alt='$alt'>\n";
//print leftline
print "<img style='float: left;' src='".LEFT."'
height='".imagesy($img)."' width='$dsw'alt='$alt'>\n";
//print image
print "<img style='float: left;' src='$image'
height='".imagesy($img)."' width='".imagesx($img)."'alt='$alt'>\n";
//print right shadow using image sizes
print "<img style='float: left;'
src='".RIGHT."'height='".imagesy($img)."'width='$dsw'alt=''>\n";
//print bottomleftcorner
print "<img style='float: left;' src='".BOT_LEFT."'
height='$dsw' width='$dsw'alt='$alt'>\n";
//print bottom shadow using image sizes
print"<img style='float: left;'
src='".BOT."'width='".imagesx($img)."'height='$dsw'alt=''>\n";
//print corner shadow using image sizes
print "<img style='float: left;'
src='".BOT_RIGHT."'height='$dsw'width='$dsw'alt=''>\n";
//print closing </div>
print "</div>\n";
}
}
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
.
- Follow-Ups:
- Re: help with framing a pic
- From: Ashok
- Re: help with framing a pic
- From: Geoff Berrow
- Re: help with framing a pic
- References:
- help with framing a pic
- From: Ashok
- help with framing a pic
- Prev by Date: Re: Diferent numbers
- Next by Date: Re: help with framing a pic
- Previous by thread: help with framing a pic
- Next by thread: Re: help with framing a pic
- Index(es):
Relevant Pages
|