DJ Mike's Tutorials: PHP

Imagemagick Functions


^

ImagickDraw::skewY

Description:
bool ImagickDraw::skewY ( float $degrees )

Skews the current coordinate system in the vertical direction.
Note: It also shifts the Y coordinates so you need to correct for the offset.
Note: You need to use skewY before other draw methods. On the example for this page, if I had used skewY after ImagickDraw::rectangle it wouldn't have done anything.
Parameters
degrees
degrees to skew
Return Values
No value is returned..

Example


<?
######################################
# make a palette to draw on
$type "png";
$image = new imagick();
$image->newimage180170"#4578ff" );
$image->setimageformat("$type");
######################################
# make some colors to draw with
$color_01 = new imagickpixel("#ff0000");
$color_02 = new imagickpixel("#00ff00");
$color_03 = new imagickpixel("#0000ff");
######################################

############## Rectangle ##############
# make a draw object
$rectangle = new imagickdraw();
# set fill color
$rectangle->setfillcolor($color_01);
# describe rectangle 
$rectangle->rectangle20208080 );
# draw rectangle
$image->drawimage($rectangle);
######################################


######### X Skewed Rectangle ##########
# make a draw object
$rectangle_x = new imagickdraw();
# set fill color
$rectangle_x->setfillcolor($color_02);
$rectangle_x->skewx(10);
# describe rectangle 
$offset = -15;
$rectangle_x->rectangle20+$offset9080+$offset150 );
# draw rectangle
$image->drawimage($rectangle_x);
######################################


######### Y Skewed Rectangle ##########
# make a draw object
$rectangle_y = new imagickdraw();
# set fill color
$rectangle_y->setfillcolor($color_03);
$rectangle_y->skewy(10);
# describe rectangle 
$offset = -30;
$rectangle_y->rectangle9020+$offset16080+$offset );
# draw rectangle
$image->drawimage($rectangle_y);
######################################

# output to browser
header("Content-type: image/$type");
echo 
$image;
?>



^

Was this webpage useful to you? You can support this website by donating.


Created by DJ Mike from Santa Barbara

DJ Mike


<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>