Imagick draw functions page 2

Set fill color
Sets the fill color to be used for drawing filled objects
Set fill color example

bool ImagickDraw::setFillColor ( ImagickPixel $fill_pixel )

<?php 
$im 
= new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor('Blue');
$draw->setStrokeColor'Black' );
$draw->setStrokeWidth(1); 
$draw->circle1007510010 );
$im->drawImage$draw );
$im->writeImage('setFillColor.jpg'); 
$im->destroy();
 
?>


Later versions accept the color as a string.
Set font
Sets the fully-specified font to use when annotating with text.
Set font example

bool ImagickDraw::setFont ( string $font_name )

<?php 
$im 
= new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor'Black' );
$draw->setFont 'handsean.ttf' );
$draw->setFontSize 30 );
$draw->setGravity (Imagick::GRAVITY_CENTER);
$draw->annotation00'Rubblewebs');
$im->drawImage$draw );
$im->writeImage('setFont.jpg'); 
$im->destroy();
 
?>
Set font size
Sets the font pointsize to use when annotating with text
Set font size example

bool ImagickDraw::setFontSize ( float $pointsize )

<?php 
$im 
= new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor'Black' );
$draw->setFont 'handsean.ttf' );
$draw->setFontSize 25 );
$draw->setGravity (Imagick::GRAVITY_NORTH);
$draw->annotation00'Rubblewebs');
$draw->setFontSize 30 );
$draw->setGravity (Imagick::GRAVITY_CENTER);
$draw->annotation00'Rubblewebs');
$draw->setFontSize 35 );
$draw->setGravity (Imagick::GRAVITY_SOUTH);
$draw->annotation00'Rubblewebs');
$im->drawImage$draw );
$im->writeImage('setFontSize.jpg'); 
$im->destroy();
 
?>
Set gravity
Sets the text placement gravity to use when annotating with text.
Set gravity example

bool ImagickDraw::setGravity ( int $gravity )

<?php $im = new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor'Black' );
$draw->setFont 'handsean.ttf' );
$draw->setFontSize 30 );
$draw->setGravity (Imagick::GRAVITY_SOUTH);
$draw->annotation00'Rubblewebs');
$im->drawImage$draw );
$im->writeImage('setGravity.jpg'); 
$im->destroy(); ?>
Set stroke color
Sets the color used for stroking object outlines
Set stroke color example

bool ImagickDraw::setStrokeColor ( ImagickPixel $stroke_pixel )

<?php 
$im 
= new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor('Blue');
$draw->setStrokeColor'Red' );
$draw->setStrokeWidth(5); 
$draw->circle1007510010 );
$im->drawImage$draw );
$im->writeImage('setStrokeColor.jpg'); 
$im->destroy();
 
?>
Set stroke width
Sets the width of the stroke used to draw object outlines
Set stroke width example

bool ImagickDraw::setStrokeWidth ( float $stroke_width )

<?php 
$im 
= new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor('Blue');
$draw->setStrokeColor'Black' );
$draw->setStrokeWidth(5); 
$draw->circle1007510010 );
$im->drawImage$draw );
$im->writeImage('setStrokeWidth.jpg'); 
$im->destroy(); ?>
Set text antialias
Controls whether text is antialiased
Set text antialias example

bool ImagickDraw::setTextAntialias ( bool $antiAlias )

<?php 
$im 
= new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor'Black' );
$draw->setFont 'handsean.ttf' );
$draw->setFontSize 30 );
$draw->setTextAntialiasFALSE );
$draw->setGravity (Imagick::GRAVITY_CENTER);
$draw->annotation00'Rubblewebs');
$im->drawImage$draw );
$im->writeImage('setTextAntialias.jpg'); 
$im->destroy();
 
?>


Text is antialiased by default.
Set text decoration
Specifies a decoration to be applied when annotating with text.
Set text decoration example

bool ImagickDraw::setTextDecoration ( int $decoration )

<?php 
$im 
= new Imagick();
$im->newImage200150'NavajoWhite' );
$draw = new ImagickDraw();
$draw->setFillColor'Black' );
$draw->setFont 'handsean.ttf' );
$draw->setFontSize 30 );
$draw->setGravity (Imagick::GRAVITY_CENTER);
$draw->setTextDecoration);
$draw->annotation00'Rubblewebs');
$im->drawImage$draw );
$im->writeImage('setTextDecoration.jpg'); 
$im->destroy();
 
?>


1 - Text will be normal
2 - Underline
3 - Upperline
4 - Stroke-through
The line is not black - tried adding a stroke color and the line is now black but the text has a stroke!