function image_overlay in ImageCache Actions 8
Same name and namespace in other branches
- 7 image_overlay.inc \image_overlay()
Places one image over another.
Parameters
stdClass $image: A valid image object.
stdClass $layer: A valid image object to be placed over or under the $image image.
int $x: Position of the overlay.
int $y: Position of the overlay.
int $alpha: Transparency of the overlay from 0-100. 0 is totally transparent. 100 (default) is totally opaque.
boolean $reverse: Flag to indicate the 'overlay' actually goes under the image.
Return value
boolean true on success, false otherwise.
4 calls to image_overlay()
- canvasactions_canvas2file_effect in canvasactions/
canvasactions.inc - Image effect callback for the underlay (background) effect.
- canvasactions_file2canvas_effect in canvasactions/
canvasactions.inc - Image effect callback for the overlay (watermark) image effect.
- canvasactions_source2canvas_effect in canvasactions/
canvasactions.inc - Image effect callback for the overlay: source image to canvas effect.
- image_gd_definecanvas in canvasactions/
canvasactions.inc - GD toolkit specific implementation of the define canvas effect.
1 string reference to 'image_overlay'
- canvasactions.inc in canvasactions/
canvasactions.inc
File
- ./
image_overlay.inc, line 28 - extension to imageapi, provide an overlay action for blending two layers, preserving transparency.
Code
function image_overlay(stdClass $image, stdClass $layer, $x, $y, $alpha = 100, $reverse = FALSE) {
if ($reverse) {
$x = imagecache_actions_keyword_filter($x, $layer->info['width'], $image->info['width']);
$y = imagecache_actions_keyword_filter($y, $layer->info['height'], $image->info['height']);
}
else {
$x = imagecache_actions_keyword_filter($x, $image->info['width'], $layer->info['width']);
$y = imagecache_actions_keyword_filter($y, $image->info['height'], $layer->info['height']);
}
return image_toolkit_invoke('overlay', $image, array(
$layer,
$x,
$y,
$alpha,
$reverse,
));
}