• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP imageSY函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中imageSY函数的典型用法代码示例。如果您正苦于以下问题:PHP imageSY函数的具体用法?PHP imageSY怎么用?PHP imageSY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了imageSY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: malaslika

function malaslika($name, $filename, $new_w, $new_h)
{
    $system = explode('.', $name);
    if (preg_match('/jpg|jpeg/i', $system[1])) {
        $src_img = imagecreatefromjpeg($name);
    }
    if (preg_match('/png/i', $system[1])) {
        $src_img = imagecreatefrompng($name);
    }
    $old_x = imageSX($src_img);
    $old_y = imageSY($src_img);
    if ($old_x > $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $old_y * ($new_h / $old_x);
    }
    if ($old_x < $old_y) {
        $thumb_w = $old_x * ($new_w / $old_y);
        $thumb_h = $new_h;
    }
    if ($old_x == $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $new_h;
    }
    $dst_img = imagecreatetruecolor($thumb_w, $thumb_h);
    imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
    if (preg_match("/png/i", $system[1])) {
        imagepng($dst_img, $filename);
    } else {
        imagejpeg($dst_img, $filename);
    }
    imagedestroy($dst_img);
    imagedestroy($src_img);
}
开发者ID:TamaraDj89,项目名称:grejmont,代码行数:33,代码来源:mala_slika.php


示例2: imgSize

 private function imgSize()
 {
     if (!$this->error) {
         $this->img_heigth = imageSY($this->img);
         $this->img_width = imageSX($this->img);
     }
 }
开发者ID:mrcoco,项目名称:RO-Framework,代码行数:7,代码来源:imageResize.php


示例3: createLogo

function createLogo($name, $filename, $new_w, $new_h)
{
    $system = explode(".", $name);
    if (preg_match("/jpg|jpeg/", $system[1])) {
        $src_img = imagecreatefromjpeg($name);
    }
    if (preg_match("/png/", $system[1])) {
        $src_img = imagecreatefrompng($name);
    }
    $old_x = imageSX($src_img);
    $old_y = imageSY($src_img);
    if ($old_x == $new_w) {
        $thumb_w = $new_w;
        $thumb_h = $new_h;
    }
    if ($old_x > $new_w) {
        $thumb_w = $new_w;
        $thumb_h = $new_h;
    }
    if ($old_x < $new_w) {
        $thumb_w = $new_w;
        $thumb_h = $new_h;
    }
    $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);
    imagecopyresampled($dst_img, $src_img, 0, 0, 10, 0, $thumb_w, $thumb_h, $new_w, $new_h);
    if (preg_match("/png/", $system[1])) {
        imagepng($dst_img, $filename);
    } else {
        imagejpeg($dst_img, $filename);
    }
    imagedestroy($dst_img);
    imagedestroy($src_img);
}
开发者ID:notlec,项目名称:testRep,代码行数:33,代码来源:MY_file_helper.php


示例4: createthumb

function createthumb($originalImage, $newName, $new_w, $new_h)
{
    $src_img = imagecreatefromjpeg($originalImage);
    $newName .= ".jpg";
    # Maintain proportions
    $old_x = imageSX($src_img);
    $old_y = imageSY($src_img);
    if ($old_x > $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $old_y * ($new_h / $old_x);
    }
    if ($old_x < $old_y) {
        $thumb_w = $old_x * ($new_w / $old_y);
        $thumb_h = $new_h;
    }
    if ($old_x == $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $new_h;
    }
    # Create destination-image-resource
    $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);
    # Copy source-image-resource to destination-image-resource
    imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
    # Create the final image from the destination-image-resource
    imagejpeg($dst_img, $newName);
    # Delete our image-resources
    imagedestroy($dst_img);
    imagedestroy($src_img);
    # Show results
    return $newName;
}
开发者ID:ritarafaeli,项目名称:notes,代码行数:31,代码来源:phpGD_functions.php


示例5: resize

function resize($src, $dest, $new_width, $new_height)
{
    if (!file_exists($src)) {
        die('No source to sample picture: ' . $src);
    }
    $image_big = ImageCreateFromJpeg($src);
    $height = imageSY($image_big);
    $width = imageSX($image_big);
    $ratio_hor = 1;
    $ratio_ver = 1;
    if ($height > $new_height) {
        $ratio_ver = $new_height / $height;
    }
    if ($width > $new_width) {
        $ratio_hor = $new_width / $width;
    }
    $ratio = min($ratio_hor, $ratio_ver);
    $new_height = round($height * $ratio);
    $new_width = round($width * $ratio);
    $image_redim = imagecreatetruecolor($new_width, $new_height);
    #l'apercu de l'image (plus petite)
    imagecopyresampled($image_redim, $image_big, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    imagejpeg($image_redim, $dest, IMAGE_REDUCED_QUALITY);
    #ecrit l'apercu sur le disque
}
开发者ID:PowerKiKi,项目名称:australia,代码行数:25,代码来源:img.php


示例6: addWatermark

 /**
  * function addWatermark
  *
  * @param string $imageFile
  * @param string $destinationFile
  */
 function addWatermark($imageFile, $destinationFile = true)
 {
     if ($destinationFile) {
         $destinationFile = $imageFile;
     }
     $watermark = @imagecreatefrompng($this->watermarkFile) or exit('Cannot open the watermark file.');
     imageAlphaBlending($watermark, false);
     imageSaveAlpha($watermark, true);
     $image_string = @file_get_contents($imageFile) or exit('Cannot open image file.');
     $image = @imagecreatefromstring($image_string) or exit('Not a valid image format.');
     $imageWidth = imageSX($image);
     $imageHeight = imageSY($image);
     $watermarkWidth = imageSX($watermark);
     $watermarkHeight = imageSY($watermark);
     if ($this->position == 'center') {
         $coordinate_X = ($imageWidth - $watermarkWidth) / 2;
         $coordinate_Y = ($imageHeight - $watermarkHeight) / 2;
     } else {
         $coordinate_X = $imageWidth - 5 - $watermarkWidth;
         $coordinate_Y = $imageHeight - 5 - $watermarkHeight;
     }
     imagecopy($image, $watermark, $coordinate_X, $coordinate_Y, 0, 0, $watermarkWidth, $watermarkHeight);
     if ($this->imageType == 'jpg') {
         imagejpeg($image, $destinationFile, 100);
     } elseif ($this->imageType == 'gif') {
         imagegif($image, $destinationFile);
     } elseif ($this->imageType == 'png') {
         imagepng($image, $destinationFile, 100);
     }
     imagedestroy($image);
     imagedestroy($watermark);
 }
开发者ID:yunsite,项目名称:demila,代码行数:38,代码来源:watermark.class.php


示例7: createImage

function createImage($name, $filename, $new_w, $new_h)
{
    $system2 = explode('.', strtolower(basename($filename)));
    $system2[1] = $system2[1];
    $src_img = imagecreatefromstring(readFileData($name));
    $old_w = imageSX($src_img);
    $old_h = imageSY($src_img);
    $thumb_w = $new_w;
    $thumb_h = $new_h;
    if ($new_w > $old_w) {
        $thumb_w = $old_w;
        $thumb_h = $thumb_w / $old_w * $old_h;
    } else {
        $thumb_w = $new_w;
        $thumb_h = $thumb_w / $old_w * $old_h;
    }
    if ($thumb_h > $new_h) {
        $thumb_h = $new_h;
        $thumb_w = $thumb_h / $old_h * $old_w;
    }
    $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);
    imagealphablending($dst_img, false);
    imagesavealpha($dst_img, true);
    $transparent = imagecolorallocatealpha($dst_img, 255, 255, 255, 127);
    imagefilledrectangle($dst_img, 0, 0, $thumb_w, $thumb_h, $transparent);
    imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_w, $old_h);
    if (preg_match("/png/", $system2[1])) {
        imagepng($dst_img, $filename);
    } else {
        imagejpeg($dst_img, $filename, 90);
    }
    imagedestroy($dst_img);
    imagedestroy($src_img);
}
开发者ID:qichangjun,项目名称:HTMLLearn,代码行数:34,代码来源:upload.php


示例8: imageResize

function imageResize($file, $info, $destination)
{
    $height = $info[1];
    //высота
    $width = $info[0];
    //ширина
    //определяем размеры будущего превью
    $y = 150;
    if ($width > $height) {
        $x = $y * ($width / $height);
    } else {
        $x = $y / ($height / $width);
    }
    $to = imageCreateTrueColor($x, $y);
    switch ($info['mime']) {
        case 'image/jpeg':
            $from = imageCreateFromJpeg($file);
            break;
        case 'image/png':
            $from = imageCreateFromPng($file);
            break;
        case 'image/gif':
            $from = imageCreateFromGif($file);
            break;
        default:
            echo "No prevue";
            break;
    }
    imageCopyResampled($to, $from, 0, 0, 0, 0, imageSX($to), imageSY($to), imageSX($from), imageSY($from));
    imagepng($to, $destination);
    imagedestroy($from);
    imagedestroy($to);
}
开发者ID:agronom81,项目名称:Lessons-about-PHP--photo-gallery,代码行数:33,代码来源:workwithimage.php


示例9: ImageResize

function ImageResize($fupload_name, $from_dir, $to_dir, $resize)
{
    //direktori gambar
    $vdir_upload = $from_dir;
    $vfile_upload = $vdir_upload . $fupload_name;
    //Simpan gambar dalam ukuran sebenarnya
    move_uploaded_file($_FILES["fupload"]["tmp_name"], $vfile_upload);
    //identitas file asli
    $im_src = imagecreatefromjpeg($vfile_upload);
    $src_width = imageSX($im_src);
    $src_height = imageSY($im_src);
    //Simpan dalam versi small 350 pixel
    //Set ukuran gambar hasil perubahan
    $dst_width = $resize;
    //perubahan ukuran gambar
    $dst_height = $dst_width / $src_width * $src_height;
    //proses perubahan ukuran
    $im = imagecreatetruecolor($dst_width, $dst_height);
    imagecopyresampled($im, $im_src, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);
    //Simpan gambar
    imagejpeg($im, $to_dir . "small_" . $fupload_name);
    //Hapus gambar di memori komputer
    imagedestroy($im_src);
    imagedestroy($im);
}
开发者ID:4guswid,项目名称:rumahkita,代码行数:25,代码来源:fungsi_thumb.php


示例10: resize_image_crop

function resize_image_crop($src_image, $width, $height)
{
    $src_width = imageSX($src_image);
    $src_height = imageSY($src_image);
    $width = $width <= 0 ? $src_width : $width;
    $height = $height <= 0 ? $src_height : $height;
    $prop_width = $src_width / $width;
    $prop_height = $src_height / $height;
    if ($prop_height > $prop_width) {
        $crop_width = $src_width;
        $crop_height = round($prop_width * $height);
        $srcX = 0;
        $srcY = round($src_height / 2) - round($crop_height / 2);
    } else {
        $crop_width = round($prop_height * $width);
        $crop_height = $src_height;
        $srcX = round($src_width / 2) - round($crop_width / 2);
        $srcY = 0;
    }
    $new_image = imageCreateTrueColor($width, $height);
    $tmp_image = imageCreateTrueColor($crop_width, $crop_height);
    imageCopy($tmp_image, $src_image, 0, 0, $srcX, $srcY, $crop_width, $crop_height);
    imageCopyResampled($new_image, $tmp_image, 0, 0, 0, 0, $width, $height, $crop_width, $crop_height);
    imagedestroy($tmp_image);
    image_unsharp_mask($new_image);
    return $new_image;
}
开发者ID:ivanovv,项目名称:metro4all,代码行数:27,代码来源:lib.image.php


示例11: UploadImage

function UploadImage($fupload_name)
{
    //direktori gambar
    $vdir_upload = "../../image/";
    $vfile_upload = $vdir_upload . $fupload_name;
    //Simpan gambar dalam ukuran sebenarnya
    move_uploaded_file($_FILES["file"]["tmp_name"], $vfile_upload);
    //identitas file asli
    $tipe_file = $_FILES['file']['type'];
    if ($tipe_file == "image/png") {
        $im_src = imagecreatefrompng($vfile_upload);
    } else {
        if ($tipe_file == "image/jpeg") {
            $im_src = imagecreatefromjpeg($vfile_upload);
        }
    }
    $src_width = imageSX($im_src);
    $src_height = imageSY($im_src);
    //Simpan dalam versi small 110 pixel
    //Set ukuran gambar hasil perubahan
    $small_width = 50;
    $small_height = $small_width / $src_width * $src_height;
    //proses perubahan ukuran
    $im = imagecreatetruecolor($small_width, $small_height);
    imagecopyresampled($im, $im_src, 0, 0, 0, 0, $small_width, $small_height, $src_width, $src_height);
    //Simpan gambar
    imagejpeg($im, $vdir_upload . "ttd_" . $fupload_name);
    //Hapus gambar di memori komputer
    imagedestroy($im_src);
    imagedestroy($im);
    unlink($vdir_upload . "" . $fupload_name);
}
开发者ID:untoms,项目名称:xskripxsip,代码行数:32,代码来源:fungsi_thumb.php


示例12: createImage

 public function createImage($text = '', $fontSize = 5)
 {
     // GD's built-in fonts are numbered from 1 - 5
     $font_size = $fontSize;
     // Calculate the appropriate image size
     $image_height = intval(imageFontHeight($font_size) * 2);
     $image_width = intval(strlen($text) * imageFontWidth($font_size) * 1.3);
     // Create the image
     $image = imageCreate($image_width, $image_height);
     // Create the colors to use in the image
     // gray background
     $back_color = imageColorAllocate($image, 216, 216, 216);
     // blue text
     $text_color = imageColorAllocate($image, 0, 0, 255);
     // black border
     $rect_color = imageColorAllocate($image, 0, 0, 0);
     // Figure out where to draw the text
     // (Centered horizontally and vertically
     $x = ($image_width - imageFontWidth($font_size) * strlen($text)) / 2;
     $y = ($image_height - imageFontHeight($font_size)) / 2;
     // Draw the text
     imageString($image, $font_size, $x, $y, $text, $text_color);
     // Draw a black border
     imageRectangle($image, 0, 0, imageSX($image) - 1, imageSY($image) - 1, $rect_color);
     // Send the image to the browser
     header('Content-Type: image/png');
     imagePNG($image);
     imageDestroy($image);
 }
开发者ID:puncoz,项目名称:presentation,代码行数:29,代码来源:images.php


示例13: run

 public function run($file)
 {
     $res = $this->open_image($file);
     if ($res != TRUE) {
         return FALSE;
     }
     $this->image_progressive = isset($this->settings['field_settings']['progressive_jpeg']) === TRUE && $this->settings['field_settings']['progressive_jpeg'] == 'yes' ? TRUE : FALSE;
     if (function_exists('imagefilter') === TRUE) {
         @imagefilter($this->EE->channel_images->image, IMG_FILTER_GRAYSCALE);
     } else {
         $img_width = imageSX($this->EE->channel_images->image);
         $img_height = imageSY($this->EE->channel_images->image);
         // convert to grayscale
         $palette = array();
         for ($c = 0; $c < 256; $c++) {
             $palette[$c] = imagecolorallocate($this->EE->channel_images->image, $c, $c, $c);
         }
         for ($y = 0; $y < $img_height; $y++) {
             for ($x = 0; $x < $img_width; $x++) {
                 $rgb = imagecolorat($this->EE->channel_images->image, $x, $y);
                 $r = $rgb >> 16 & 0xff;
                 $g = $rgb >> 8 & 0xff;
                 $b = $rgb & 0xff;
                 $gs = $r * 0.299 + $g * 0.587 + $b * 0.114;
                 imagesetpixel($this->EE->channel_images->image, $x, $y, $palette[$gs]);
             }
         }
     }
     $this->save_image($file);
     return TRUE;
 }
开发者ID:ayuinc,项目名称:laboratoria-v2,代码行数:31,代码来源:action.greyscale.php


示例14: imagecreator

 function imagecreator($filename)
 {
     $nx = 16;
     $ny = 8;
     $zoom = 4;
     $im = imageCreateFromJpeg("uploads/" . $filename);
     $temp_dir = "dir_{$filename}";
     mkdir("uploads/" . $temp_dir, 0744);
     $temp_dir = "uploads/" . $temp_dir;
     //return;
     $imSX = imageSX($im);
     $imSY = imageSY($im);
     $kusokX = $imSX / $nx;
     $kusokY = $imSY / $ny;
     for ($k = 0; $k < $ny; $k++) {
         for ($i = 0; $i < $nx; $i++) {
             $im2 = imagecreatetruecolor(512, 512);
             imagecopyresized($im2, $im, 0, 0, $i * $kusokX, $k * $kusokY, 512, 512, $kusokX, $kusokY);
             //imageInterlace($im2, 1);
             imagejpeg($im2, "{$temp_dir}/" . "1_{$zoom}_{$i}_{$k}_.jpeg", 90);
             $im2 = null;
         }
     }
     $factor = 2;
     $zoom = $zoom - 1;
     for ($k = 0; $k < $ny / $factor; $k++) {
         for ($i = 0; $i < $nx / $factor; $i++) {
             $im2 = imagecreatetruecolor(512, 512);
             imagecopyresized($im2, $im, 0, 0, $i * $kusokX * $factor, $k * $kusokY * $factor, 512, 512, $kusokX * $factor, $kusokY * $factor);
             //imageInterlace($im2, 1);
             imagejpeg($im2, "{$temp_dir}/" . "1_{$zoom}_{$i}_{$k}_.jpeg", 90);
             $im2 = null;
         }
     }
     $factor = 4;
     $zoom = $zoom - 1;
     for ($k = 0; $k < $ny / $factor; $k++) {
         for ($i = 0; $i < $nx / $factor; $i++) {
             $im2 = imagecreatetruecolor(512, 512);
             imagecopyresized($im2, $im, 0, 0, $i * $kusokX * $factor, $k * $kusokY * $factor, 512, 512, $kusokX * $factor, $kusokY * $factor);
             //imageInterlace($im2, 1);
             imagejpeg($im2, "{$temp_dir}/" . "1_{$zoom}_{$i}_{$k}_.jpeg", 90);
             $im2 = null;
         }
     }
     $factor = 8;
     $zoom = $zoom - 1;
     for ($k = 0; $k < $ny / $factor; $k++) {
         for ($i = 0; $i < $nx / $factor; $i++) {
             $im2 = imagecreatetruecolor(512, 512);
             imagecopyresized($im2, $im, 0, 0, $i * $kusokX * $factor, $k * $kusokY * $factor, 512, 512, $kusokX * $factor, $kusokY * $factor);
             //imageInterlace($im2, 1);
             imagejpeg($im2, "{$temp_dir}/" . "1_{$zoom}_{$i}_{$k}_.jpeg", 90);
             $im2 = null;
         }
     }
     $im2 = imagecreatetruecolor(512, 512);
     imagecopyresized($im2, $im, 0, 0, 0, 0, 512, 256, $imSX, $imSY);
     imagejpeg($im2, "{$temp_dir}/" . "1_0_0_0_.jpeg", 90);
 }
开发者ID:marcelo066,项目名称:codeigniter-admin-svn,代码行数:60,代码来源:pano_model.php


示例15: createthumb

 function createthumb($name, $filename, $new_w, $new_h)
 {
     $extention = pathinfo($name, PATHINFO_EXTENSION);
     if (preg_match('/jpg|jpeg/', $extention)) {
         $src_img = imagecreatefromjpeg($name);
     }
     if (preg_match('/png/', $extention)) {
         $src_img = imagecreatefrompng($name);
     }
     $old_x = imageSX($src_img);
     $old_y = imageSY($src_img);
     if ($old_x > $old_y) {
         $thumb_w = $new_w;
         $thumb_h = $old_y * ($new_h / $old_x);
     }
     if ($old_x < $old_y) {
         $thumb_w = $old_x * ($new_w / $old_y);
         $thumb_h = $new_h;
     }
     if ($old_x == $old_y) {
         $thumb_w = $new_w;
         $thumb_h = $new_h;
     }
     $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);
     imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
     if (preg_match("/png/", $extention)) {
         imagepng($dst_img, $filename);
     } else {
         imagejpeg($dst_img, $filename);
     }
     imagedestroy($dst_img);
     imagedestroy($src_img);
 }
开发者ID:rocketpastsix,项目名称:foxycms,代码行数:33,代码来源:uploads.php


示例16: createthumb

function createthumb($originalImage, $new_w, $new_h)
{
    $src_img = imagecreatefromjpeg("uploads/" . $originalImage);
    # Add the _t to our image name
    list($imageName, $extension) = explode(".", $originalImage);
    $newName = $imageName . "_t." . $extension;
    # Maintain proportions
    $old_x = imageSX($src_img);
    $old_y = imageSY($src_img);
    if ($old_x > $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $old_y * ($new_h / $old_x);
    }
    if ($old_x < $old_y) {
        $thumb_w = $old_x * ($new_w / $old_y);
        $thumb_h = $new_h;
    }
    if ($old_x == $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $new_h;
    }
    # Create destination-image-resource
    $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);
    # Copy source-image-resource to destination-image-resource
    imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
    # Create the final image from the destination-image-resource
    imagejpeg($dst_img, "uploads/" . $newName);
    # Delete our image-resources
    imagedestroy($dst_img);
    imagedestroy($src_img);
    # Show results
    return $newName;
}
开发者ID:ritarafaeli,项目名称:notes,代码行数:33,代码来源:uploaderExample_functions.php


示例17: resize

function resize($image, $width = false, $height = false)
{
    $original_width = imageSX($image);
    $original_height = imageSY($image);
    // ---------------------------------------------------------------------
    if ($height != false && is_numeric($height)) {
        $size["height"] = $height;
    } else {
        $size["height"] = $width * $original_height / $original_width;
    }
    // ---------------------------------------------------------------------
    if ($width != false && is_numeric($width)) {
        $size["width"] = $width;
    } else {
        $size["width"] = $height * $original_width / $original_height;
    }
    // ---------------------------------------------------------------------
    if ($original_width / $original_height > $size["width"] / $size["height"]) {
        // crop from either sides
        $rect_width = $original_height * ($size["width"] / $size["height"]);
        return crop($image, array("left" => ($original_width - $rect_width) / 2, "top" => 0, "width" => $rect_width, "height" => $original_height), array("width" => $size["width"], "height" => $size["height"]));
    } else {
        // crop from bottom
        $rect_height = $original_width * ($size["height"] / $size["width"]);
        return crop($image, array("left" => 0, "top" => 0, "width" => $original_width, "height" => $rect_height), array("width" => $size["width"], "height" => $size["height"]));
    }
}
开发者ID:vishva8kumara,项目名称:tinyF-x2-,代码行数:27,代码来源:image_magic.php


示例18: UploadImage

function UploadImage($bukti_name)
{
    //direktori gambar
    $vdir_upload = "bukti/";
    $vfile_upload = $vdir_upload . $bukti_name;
    //Simpan gambar dalam ukuran sebenarnya
    move_uploaded_file($_FILES["bukti"]["tmp_name"], $vfile_upload);
    //identitas file asli
    $im_src = imagecreatefromjpeg($vfile_upload);
    $src_width = imageSX($im_src);
    $src_height = imageSY($im_src);
    //Simpan dalam versi small 110 pixel
    //Set ukuran gambar hasil perubahan
    $dst_width = 50;
    $dst_height = $dst_width / $src_width * $src_height;
    //proses perubahan ukuran
    $im = imagecreatetruecolor($dst_width, $dst_height);
    imagecopyresampled($im, $im_src, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);
    //Simpan gambar
    imagejpeg($im, $vdir_upload . "small_" . $bukti_name);
    //Simpan dalam versi medium 360 pixel
    //Set ukuran gambar hasil perubahan
    $dst_width2 = 270;
    $dst_height2 = $dst_width2 / $src_width * $src_height;
    //proses perubahan ukuran
    $im2 = imagecreatetruecolor($dst_width2, $dst_height2);
    imagecopyresampled($im2, $im_src, 0, 0, 0, 0, $dst_width2, $dst_height2, $src_width, $src_height);
    //Simpan gambar
    imagejpeg($im2, $vdir_upload . "medium_" . $bukti_name);
    //Hapus gambar di memori komputer
    imagedestroy($im_src);
    imagedestroy($im);
    imagedestroy($im2);
}
开发者ID:Zame31,项目名称:SifutProject,代码行数:34,代码来源:upload.php


示例19: fillCanvas

 /**
  * Fill the canvas with the specified colosaver.
  *
  * @param Color $fillcolor The Color() to fill with.
  */
 function fillCanvas(Color $fillcolor)
 {
     $w = imageSX($this->himage);
     $h = imageSY($this->himage);
     imagealphablending($this->himage, false);
     imagefilledrectangle($this->himage, 0, 0, $w, $h, $fillcolor->getColor($this->himage, true));
     imagealphablending($this->himage, $this->canvas->alphablending);
 }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:13,代码来源:canvaspainter.php


示例20: __construct

 /**
  * @param int $x The X offset (positive values from left, negative from right)
  * @param int $y The Y offset (positive valeus from top, negative from bottom)
  * @param string $watermark The watermark image to apply
  * @param int $placement The placement method to use
  */
 function __construct($x, $y, $watermark, $placement = WatermarkImageFilter::POS_RELATIVE)
 {
     $this->hwatermark = imagecreatefromstring(file_get_contents($watermark));
     $this->x = $x;
     $this->y = $y;
     $this->placement = $placement;
     $this->width = imageSX($this->hwatermark);
     $this->height = imageSY($this->hwatermark);
 }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:15,代码来源:watermark.php



注:本文中的imageSY函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP imageSaveAlpha函数代码示例发布时间:2022-05-15
下一篇:
PHP imageSX函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap