You are here

function _textimage_draw_box in Textimage 7.3

Draw a box.

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_box()
image_gd_textimage_text_to_image in effects/textimage_text.gd.inc
Creates a new image resource and overlays the text over it.
_textimage_draw_debug_box in effects/textimage_text.inc
Display a polygon enclosing the text line, and conspicuous points.

File

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

Code

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

  // Check color.
  if (!$rgba) {
    $rgba = '#00000000';
  }
  elseif ($luma) {
    $rgba = textimage_match_luma($rgba);
  }

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