Most recent edit on 2007-09-26 12:26:02 by GasperKozak
Additions:
~- $x (int): left position on the target image
- $y (int): top position on the target image
CategoryDocApi
Deletions:
~- $x (int): left position on the target image (SvnOnly)
- $y (int): top position on the target image (SvnOnly)
CategoryDocApi CategoryDocSvn
Edited on 2007-07-24 16:00:43 by GasperKozak
Additions:
~- $x (int): left position on the target image (SvnOnly)
- $y (int): top position on the target image (SvnOnly)
Deletions:
~- $x (int): left position on the target image (in svn only)
$y (int): top position on the target image (in svn only)
Edited on 2007-06-06 00:39:10 by GasperKozak
Additions:
CategoryDocApi CategoryDocSvn
Deletions:
CategoryDocApi CategorySvnDoc
Edited on 2007-06-06 00:38:57 by GasperKozak
Additions:
wiImage::applyMask($mask, $x = 0, $y = 0)
$x (int): left position on the target image (in svn only)
$y (int): top position on the target image (in svn only)
CategoryDocApi CategorySvnDoc
Deletions:
wiImage::applyMask($mask)
CategoryDocApi
Edited on 2007-05-04 03:19:15 by GasperKozak
Additions:
~- result (wiTrueColorImage): masked image
Deletions:
~- result (wiTrueColorImage): resized image
Oldest known version of this page was edited on 2007-03-03 11:53:32 by GasperKozak []
Page view:
wiImage::applyMask()
See:
List of operations
Signature
wiImage::applyMask($mask)
Parameters
- $mask (wiImage): the mask image. This should be a greyscale image, like the ones created with [image_asMask wiImage::asMask()].
- result (wiTrueColorImage): resized image
Description
Returns a copy of the image with the mask applied. The mask is a greyscale image, which specifies the alpha channel of the newly created image. Black areas are completely transparent, white are completely opaque, colors between specify the value of alpha color component.
Notes
This method is slow, because it's implemented in pure PHP.
Examples
$img = wiImage::load('/path/to/an/image.png');
$mask = wiImage::load('/path/to/mask.png');
$masked = $img->applyMask($mask);
$masked->saveToFile(...);
CategoryDocApi