You are here

function ctools_stylizer_image_processor::merge in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/stylizer.inc \ctools_stylizer_image_processor::merge()

Merge two images together, preserving alpha transparency.

3 calls to ctools_stylizer_image_processor::merge()
ctools_stylizer_image_processor::command_merge_from in includes/stylizer.inc
Copy the contents of one workspace into the current workspace.
ctools_stylizer_image_processor::command_merge_from_file in includes/stylizer.inc
Blend an image into the current workspace.
ctools_stylizer_image_processor::command_merge_to in includes/stylizer.inc

File

includes/stylizer.inc, line 639
Create customized CSS and images from palettes created by user input.

Class

ctools_stylizer_image_processor

Code

function merge(&$from, &$to, $x, $y) {

  // Blend over template.
  $width = imagesx($from);
  $height = imagesy($from);

  // Re-enable alpha blending to make sure transparency merges.
  imagealphablending($to, TRUE);
  imagecopy($to, $from, $x, $y, 0, 0, $width, $height);
  imagealphablending($to, FALSE);
}