473,796 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CODE - Photo-ize your pix

Easy function that makes a pic look like a 3D photo. Needed images are
included. Place images in directory called i

//-------------------------
function photoIt($_pic,
$_float = 'right',
$_alt = 'PCXPRESS') {
if ( file_exists($_p ic) ) {
list($_w, $_h, $_t, $_a) = getimagesize($_ pic);
$_wide = $_w + 11 + 17;
$_high = $_h + 12 + 16;
$_w .= "px";
$_h .= "px";
$_wide .= "px";
$_high .= "px";
print "<SPAN STYLE='float: $_float; border: 0px; width:
$_wide; height: $_high; ";
print "margin: 0px; padding: 0px;'>";
print "<IMG STYLE='margin: 0px; height: 12px; width: 11px;'
SRC='i/phTopLef.jpg'>" ;
print "<IMG STYLE='margin: 0px; height: 12px; width: $_w;'
SRC='i/phTop.jpg'>";
print "<IMG STYLE='margin: 0px; height: 12px; width: 17px;'
SRC='i/phTopRig.jpg'>" ;
print "<IMG STYLE='margin: 0px; height: $_h; width: 11px;'
SRC='i/phLeft.jpg'>";
print "<IMG STYLE='margin: 0px; height: $_h; width: $_w;'
ALT='$_alt' SRC='$_pic'>";
print "<IMG STYLE='margin: 0px; height: $_h; width: 17px;'
SRC='i/phRight.jpg'>";
print "<IMG STYLE='margin: 0px; height: 16px; width: 11px;'
SRC='i/phBotLef.jpg'>" ;
print "<IMG STYLE='margin: 0px; height: 16px; width: $_w;'
SRC='i/phBottom.jpg'>" ;
print "<IMG STYLE='margin: 0px; height: 16px; width: 17px;'
SRC='i/phBotRig.jpg'>" ;
print "</SPAN>";
} else {
print "<IMG BORDER=0 SRC='bogusPic' ALT='NO PHOTO'>";
}
}






Jul 17 '05 #1
0 1431

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2600
by: Philip D Heady | last post by:
Ok, here's my code. Can't get it to check file extension properly or file size...had it working before but not sure why it's buggy now. } elseif ($photo) { $ext = strtolower(substr($photo, -3)); if ($ext == "peg") { $ext = "jpg"; } if ($ext != "gif" || $ext != "jpg" || $ext != "jpeg" || $ext !="bmp" )
2
9558
by: Eric McDaniel | last post by:
I am trying to read in a bunch of images and manipulate them using Image::Magick, then display them using Tk::Photo. I would like to do this without creating a temp file for each image, since there can be quite a few of them. However, I can't make Tk::Photo understand the data returned by Image::Magick's ImageToBlob() function. Here is the way I had hoped it would work: #!perl
9
11831
by: fleemo17 | last post by:
I'm hoping a CSS guru can help me with what seems like a simple enough goal. What I'm going for is a large photo centered in the browser with text positioned on top of it. Using the CSS below, when the user resizes their browser window, the photo centers in the browser fine but the text box stays locked on the left hand side. Is there a way to have the text box move in relation to the photo when the browser is resized? Here's my CSS:
3
5925
by: Ken | last post by:
I have a database called autographs.mdb that is in the "XYZ" folder in the "database" folder. I have a form in the database that I want to display a photo of the celeb on. The photos are in a "graphics" folder that is on the same level as the "xyz" folder. The only way I can seem to make it work is to put the entire path including hard drive in the table (c:\database\graphics\photo.jpg). But I also want to upload the database to the web...
1
2188
by: Bill Strass | last post by:
I have a form showing the records of different people. I would like a photo to be displayed in the form, with each person's record. My digital photo > *.jpg type file and I change each photo to *.bmp format using SnagIt. I created an OLE type field in the table to store either the embedded photo or a link to the photo (I'll decide which method to use,
3
2988
by: Guadala Harry | last post by:
Here's the functionality I'm after: I need for a page to display a photo. When users click on other links within the page, the photo changes. I'd like to swap out the photo without doing a Postback of the entire page. I initially implemented this with an aspx page that contains an IFame which displays only the picture (gif). The behavior was what I wanted, but the problem is that the IFrame does not resize with the photo......
2
1517
by: RC | last post by:
I want to display photos and when the user clicks on one the photo gets displayed in its own window. This is what I"m currently using. <A id="picAnchor" target="_blank" href="../Photos/somePic.jpg"><img src='../Photos/ etc... </A> It works great - as expected the photo shows up in a new browser window. The thing is that I want the photo to show up in its own window - but to have the new window's size conform to the size of the image...
13
4350
by: Viken Karaguesian | last post by:
Hello everyone, Can anyone recommend a good online site to learn PHP? The W3Schools website is quite lacking - leaves much to be desired. I'm sure there are many places, but which ones are good? I currently run a site with an extensive photo gallery. Hundreds of photos. Right now I have a system which the thumbnails are laid out in a table. You click on a thumbnail and you see the full size picture. That full size picture is in its...
1
2234
by: Throw | last post by:
G'day everyone I'm looking for a simple photo gallery script in PHP (or Perl), but not too simple. I have tried several photo gallery scripts in either language and I have found that they are either too complex or too simple for my purpose. Most photo gallery scripts are intended primarily for sharing new photos continuously and allowing visitors to comment on them. I want something more static, which allows more text content.
3
1319
by: boyet59 | last post by:
VerosMedia.com offers professional, digital retouching and photo restoration services. ** Restoration of treasured, family photographs. ** Portrait and model portfolio retouching. ** Photo enhancement. ** Photo alteration and editing. ** No advanced fee. ** Flat rate service. ** Free evaluation.
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.