Simple examples
Simple load, resize and save:
$image = wiImage::load('/path/to/an/image.png');
$resized = $image->resize(400, 300);
$resized->saveToFile('/path/to/resized.png');
Chaining operations:
$img = wiImage::load('image.png');
$img->resize(200, 500)->saveToFile('new.png');
A long chain:
$img = wiImage::load('image.png');
$img->resize(200, 500)->crop(10, 10, 80, 80)->asGrayscale()->saveToFile('new.png');
Load, crop, flip and output to browser in one line (no http headers included):
echo wiImage::
load('image.png')->
crop(30,
30,
'50%',
'50%')->
flip()->
asString('png');
Merge example:
$img = wiImage::load('pic.jpeg');
$watermark = wiImage::load('watermark.jpg');
$new_img = $img->merge($watermark, 40, 80);
For more, see
ImageOperations.
CategoryDoc
There are no comments on this page. [Add comment]