background image

$image

->save('picture2.jpg');?>

缩放后直接输出到屏幕
<?php
header('Content-Type: image/jpeg');

include

('SimpleImage.php');

$image

 = 

new

 SimpleImage();

$image

->load('picture.jpg');

$image

->resizeToWidth(150);

$image

->output();?>

 
SimpleImage.php 源码请轻点文章开头链接,到那下载
--------------------------------------------------------------------------------
为图片加上水印
代码如下:
 
<?php

$source

=imagecreatefromjpeg('E:/image/guide_pic.jpg');

$thumb

=imagecreatefromjpeg('E:/image/l.JPG');

//取得图片的宽度,高度,类型

list(

$width

,

$height

,

$mine

)=

getimagesize

('E:/image/guide_pic.jpg');

imagecopymerge (

$source

,

$thumb

,

$width

-124,

$height

-150,0,0,88,73,70);

//生成图片

imagejpeg(

$source

,'E:/image/logo.jpg');

?>