You are here

function _textimage_draw_rectangle in Textimage 7.3

Draw a rectangle.

Parameters

object $image: Image object.

array $points: Box points coordinates array.

string $rgba: RGBA color of the rectangle.

bool $luma: if TRUE, convert RGBA to best match using luma.

2 calls to _textimage_draw_rectangle()
image_gd_textimage_text_to_image in effects/textimage_text.gd.inc
Creates a new image resource and overlays the text over it.
textimage_text_effect in effects/textimage_text.inc
Implements 'textimage_text' image effect callback.

File

effects/textimage_text.inc, line 1389
Implementation of the 'textimage_text' image effect.

Code

function _textimage_draw_rectangle($image, $points, $rgba, $luma = FALSE) {

  // Check color.
  if ($rgba && $luma) {
    $rgba = textimage_match_luma($rgba);
  }

  // Invoke toolkit.
  $data = array(
    'points' => $points,
    'num_points' => 4,
    'border_color' => NULL,
    'fill_color' => $rgba,
  );
  return image_toolkit_invoke('textimage_draw_polygon', $image, array(
    $data,
  ));
}