WideImage logo

WideImage Wiki : SimpleExamples

MainPage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
SourceForge.net Logo

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]

WideImage - an Object-Oriented PHP Image Library for Image manipulation
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 1.3639 seconds