PDA

View Full Version : سوال: قابليت زوم در پي اچ پي



fafa_na
پنج شنبه 01 بهمن 1388, 09:17 صبح
سلام
لطفا اگه كسي اطلاعي درباره زوم در پي اچ پي داره يا كتابي يا مقاله داره
لطفا زودي بمن بده
نياز فوري فوري
ايميل:sharify_saftware@yahoo.com

fafa_na
شنبه 03 بهمن 1388, 12:27 عصر
بله ، قابلیت zoom بر روی عکس در php
بشه هر قسمتی از عکس را که میخواهیم روی آن کلیک کنیم و آن قسمت نمایش داده شود
منظورم resize نیست که عکس بزرگ و کوچک بشه
مرسسسسسسسسسسسسسسسسسسسسسسس سسسی

fafa_na
یک شنبه 04 بهمن 1388, 10:09 صبح
یکی جواب بده

sama01
یک شنبه 04 بهمن 1388, 11:40 صبح
پاسخ به سوال شما کاملا بستگی به این داره که دقیقا قراره چه کاری انجام بشه.
منظروم این نیست که جواب بدید کاربر یه جا کلیک می‌کنه و آن قسمت بزرگ می‌شه.
منظورم اینه که الگوریتم کلی رو توضیح بدید تا معلوم بشه چه کدی می‌خواهید.

در برخی موارد حتی نیاز به php هم نیست. و این بستگی به کاری دارد که شما می‌خواهید انجام دهید.

fafa_na
یک شنبه 04 بهمن 1388, 14:33 عصر
دقیقا قابلیت zoom in و zoom out در preview عکس ها در ویندوز
نمیدونم تونستم خوب توضیح بدم یانه.
یه نگا به سایت gucci.com بندارید فکر کنم دیگه کاملا نیازمو میفهمید
لطفا جواب بدید

fafa_na
یک شنبه 04 بهمن 1388, 15:51 عصر
ممنون از جواب دادنتون ولی من هیچی نفهمیدم
دیدید وقتی آدم گیر میافته چطور گیج و گنگ میشه :عصبانی++:
من حالا اونجوری هستم
لطفا اگه کد دارید بهم بدید یا حداقل زیر دیپلم حرف بزنید بفهمم:ناراحت:
Jquery چیه ؟
پلاگین دیگه چیه
واااااااااااااااااااااااا ی:متعجب:

امیـرحسین
یک شنبه 04 بهمن 1388, 20:16 عصر
یه پک خیلی معروف توی PHP هست به نام phpThumb (http://phpthumb.sourceforge.net/) که با عکس آب هویج هم میگیره. احتمالا مشکلتون رو حل کنید.
غیر از اون، داشتم سرچ می کردم دیدم یکی این کلاس رو ساخته گذاشته تو یه فروم. چک کنید شاید خوب باشه:
<?php
/**
* Cropping Images using PHP
* This script will allow you to make a smaller image of a bigger image, but at the same time crop it.
* This will prevent the image looking stretched and deformed.
*
* Author: Rendair ~ www.jooney.co.uk
* Source: http://www.talkphp.com/advanced-php-programming/1709-cropping-images-using-php.html
*/
class cropImage {

/*
* we need to set up some variables to be used throughout the program.
*/
var $imgSrc,$myImage,$cropHeight,$cropWidth,$x,$y,$thu mb;


/*
* The variables above will be explained once we use them.
* Now we need to create the first function.
* This function will get the image we are going to crop, work out its dimension and then use them dimensions to work out how we are going to crop it.
*/
function setImage($image) {
//Your Image
$this->imgSrc = $image;

//getting the image dimensions
list($width, $height) = getimagesize($this->imgSrc);

//create image from the jpeg
this->myImage = imagecreatefromjpeg($this->imgSrc) or die("Error: Cannot find image!");

if($width > $height) $biggestSide = $width; //find biggest length
else $biggestSide = $height;

//The crop size will be half that of the largest side
$cropPercent = .5; // This will zoom in to 50% zoom (crop)
$this->cropWidth = $biggestSide*$cropPercent;
$this->cropHeight = $biggestSide*$cropPercent;


//getting the top left coordinate
$this->x = ($width-$this->cropWidth)/2;
$this->y = ($height-$this->cropHeight)/2;
}


/*
* we actually need to start creating the actual cropped image.
*/
function createThumb(){
$thumbSize = 250; // will create a 250 x 250 thumb
$this->thumb = imagecreatetruecolor($thumbSize, $thumbSize);

imagecopyresampled($this->thumb, $this->myImage, 0, 0,$this->x, $this->y, $thumbSize, $thumbSize, $this->cropWidth, $this->cropHeight);
}

/*
* all we need to do is render the image out.
*/
function renderImage() {
header('Content-type: image/jpeg');
imagejpeg($this->thumb);
imagedestroy($this->thumb);
}
}




/*
* You can use this script to display a thumb of images on a new page, by using the following page.
*/
$image = new cropImage;
$image->setImage($src);
$image->createThumb();
$image->renderImage();


/*
* You can use this script to display a thumb of images on a new page, by using the following page.
*
* <img src="thumbcreate.php?src=images/largimg.jpg">
*/
?>

fafa_na
دوشنبه 05 بهمن 1388, 16:14 عصر
سلام
بچه ها بالاخره با کمک شما :لبخند:فهمیدم
حالا فایلو میذارم تا هر کس نیاز داره زیاد حرص نخوره
امیدوارم به دردتون بخوره
بازم دست همگی درد نکنه:تشویق:
مرسسسسسسسسسسسسسسسسسسسسسسس سسسسی