It appears you have not yet registered with our community. To register please click here...


Small photos to big photos on same page

This is a discussion on Small photos to big photos on same page within the Graphics Discussion forums. Topic: I have seen websites where an arrangement of several photos is displayed. The user can see an enlarged photo by ...


Reply
 
Postbit Seperator LinkBack Thread Tools Postbit Seperator Display Modes
Old 08-07-2008, 02:37 AM   #1 (permalink)
 
Status: Junior Member
Join Date: Jun 2008
Posts: 21
Trader Rating: (0)
Emily0415 is on a distinguished road
TD$: 470.00
Donate
Default Small photos to big photos on same page
I have seen websites where an arrangement of several photos is displayed. The user can see an enlarged photo by clicking or mouseover a small photo. The larger photo is displayed on the same page at the side of the arrangement of the smaller photos or in some other place on the same page.

The big photo is replaced by another big photo when the user selects another small photo
I am wondering where I can find a program to do this, or will I have to work from a script? At present I am using Frontpage 2002 but I am upgrading to MS Expresson Web 2.0 soon.
Emily0415 is offline   Reply With Quote
Old 09-26-2008, 01:36 PM   #2 (permalink)
 
Status: Member
Join Date: Jul 2008
Posts: 40
Trader Rating: (0)
sujal is on a distinguished road
TD$: 225.00
Donate
Default Re: Small photos to big photos on same page
hi

here it is code for Resizing an image in PHP and also maintaining its aspect ratio

A question that has been asked many times is how to resize an image in PHP while maintaining the aspect ration of the original image.

The function below does just that, it takes an image resource and the new dimensions for the image in pixels and returns the resized image.
Code:
/**
* Resize and image while maintaining its aspect ratio.
*
* @param resource $src The image to resize.
* @param int $w The target width.
* @param int $h The target height.
* @return resource The resized image or the original image if it did not need to be scaled.
*/
function resizeImage($src, $w, $h) {

// Get the current size
$width = ImageSx($src);
$height = ImageSy($src);

// If one dimension is right then nothing to do
if($width == $w || $height == $h)
return($src);

// Calculate new size
if(($w - $width) > ($h - $height)) { // use height
$s = $h / $height;
$nw = round($width * $s);
$nh = round($height * $s);
}
else { // Use width
$s = $w / $width;
$nw = round($width * $s);
$nh = round($height * $s);
}

// Resize to correct size
$im = ImageCreateTrueColor($nw, $nh);
ImageCopyResampled($im, $src, 0, 0, 0, 0, $nw, $nh, $width, $height);

// Return the new image
return($im);
}
A simple example to load, resize and send an image to the browser would be:
Code:
$image = ImageCreateFromJPEG('images.jpg');
$image = resizeImage($image, 400, 400);
header("Content-Type: image/jpeg");
ImageJPEG($image, '', 80);

hope you like it
thanks
sujal is offline   Reply With Quote
Old 10-08-2008, 11:04 AM   #3 (permalink)
 
Status: Junior Member
Join Date: Sep 2008
Posts: 19
Trader Rating: (0)
guru456 is on a distinguished road
TD$: 115.00
Donate
Default Re: Small photos to big photos on same page
thanks sujal

its working.
guru456 is offline   Reply With Quote
Table Bottom LeftTable BottomTable Bottom Right
Reply


Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Small Magazine - A magazine style free WordPress theme mhmtozek Web Design Resources 0 06-18-2008 08:10 AM
Two Premium Wordpress Themes - Old Photos & Blue Ace - FREE Download dpSubi1 Web Design Resources 0 06-11-2008 05:39 PM
Passing realtime data to web page via CSS gurro HTML & CSS 0 04-21-2008 08:23 AM
Fresh New PLR material on Hot Niche - 5230 words + 10 page site nikolaaa Other Offers & Requests 0 09-18-2007 09:59 AM
Where to get photos for web design? ALINA Web Design Resources 1 08-15-2007 08:40 PM


Home | Site Map | Contact | Archive | Top

 

Copyright © 2007 - 2010 iTalkWebs Network

Search Engine Optimization by vBSEO 3.1.0