You are here

function _textimage_create_transparent_image in Textimage 5

Creates transparent image resources for images with graphic backgrounds

3 calls to _textimage_create_transparent_image()
textimage_image_add_margin in ./textimage.module
This function adds a margin (or border) around an existing image resource
textimage_image_add_stroke in ./textimage.module
Stroke function adds a solid color stroke around an image with a transparent background.
textimage_text_to_image in ./textimage.module
Generate an image containing text with the given parameters.

File

./textimage.module, line 1202

Code

function _textimage_create_transparent_image($x, $y) {
  $i = imagecreatetruecolor($x, $y);
  $b = imagecreatefromstring(base64_decode(_textimage_blankpng()));
  imagealphablending($i, false);
  imagesavealpha($i, true);
  imagecopyresized($i, $b, 0, 0, 0, 0, $x, $y, imagesx($b), imagesy($b));
  return $i;
}