ImagickDraw::rectangle
(No version information available, might be only in CVS)
ImagickDraw::rectangle — Draws a rectangle
Описание
bool ImagickDraw::rectangle
( float $x1
, float $y1
, float $x2
, float $y2
)
Внимание
К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.
Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings.
Список параметров
- x1
-
x coordinate of the top left corner
- y1
-
y coordinate of the top left corner
- x2
-
x coordinate of the bottom right corner
- y2
-
y coordinate of the bottom right corner
Возвращаемые значения
Эта функция не возвращает значения после выполнения.
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Обработка и генерация изображений
- Обработка изображений (ImageMagick)
- Функция ImagickDraw::affine() - Adjusts the current affine transformation matrix
- Функция ImagickDraw::annotation() - Draws text on the image
- Функция ImagickDraw::arc() - Draws an arc
- Функция ImagickDraw::bezier() - Draws a bezier curve
- Функция ImagickDraw::circle() - Draws a circle
- Функция ImagickDraw::clear() - Clears the ImagickDraw
- Функция ImagickDraw::clone() - Makes an exact copy of the specified ImagickDraw object
- Функция ImagickDraw::color() - Draws color on image
- Функция ImagickDraw::comment() - Adds a comment
- Функция ImagickDraw::composite() - Composites an image onto the current image
- Функция ImagickDraw::__construct() - The ImagickDraw constructor
- Функция ImagickDraw::destroy() - Frees all associated resources
- Функция ImagickDraw::ellipse() - Draws an ellipse on the image
- Функция ImagickDraw::getClipPath() - Obtains the current clipping path ID
- Функция ImagickDraw::getClipRule() - Returns the current polygon fill rule
- Функция ImagickDraw::getClipUnits() - Returns the interpretation of clip path units
- Функция ImagickDraw::getFillColor() - Returns the fill color
- Функция ImagickDraw::getFillOpacity() - Returns the opacity used when drawing
- Функция ImagickDraw::getFillRule() - Returns the fill rule
- Функция ImagickDraw::getFont() - Returns the font
- Функция ImagickDraw::getFontFamily() - Returns the font family
- Функция ImagickDraw::getFontSize() - Returns the font pointsize
- ImagickDraw::getFontStretch
- Функция ImagickDraw::getFontStyle() - Returns the font style
- Функция ImagickDraw::getFontWeight() - Returns the font weight
- Функция ImagickDraw::getGravity() - Returns the text placement gravity
- Функция ImagickDraw::getStrokeAntialias() - Returns the current stroke antialias setting
- Функция ImagickDraw::getStrokeColor() - Returns the color used for stroking object outlines
- Функция ImagickDraw::getStrokeDashArray() - Returns an array representing the pattern of dashes and gaps used to stroke paths
- Функция ImagickDraw::getStrokeDashOffset() - Returns the offset into the dash pattern to start the dash
- Функция ImagickDraw::getStrokeLineCap() - Returns the shape to be used at the end of open subpaths when they are stroked
- Функция ImagickDraw::getStrokeLineJoin() - Returns the shape to be used at the corners of paths when they are stroked
- Функция ImagickDraw::getStrokeMiterLimit() - Returns the stroke miter limit
- Функция ImagickDraw::getStrokeOpacity() - Returns the opacity of stroked object outlines
- Функция ImagickDraw::getStrokeWidth() - Returns the width of the stroke used to draw object outlines
- Функция ImagickDraw::getTextAlignment() - Returns the text alignment
- Функция ImagickDraw::getTextAntialias() - Returns the current text antialias setting
- Функция ImagickDraw::getTextDecoration() - Returns the text decoration
- Функция ImagickDraw::getTextEncoding() - Returns the code set used for text annotations
- ImagickDraw::getTextInterlineSpacing
- ImagickDraw::getTextInterwordSpacing
- ImagickDraw::getTextKerning
- Функция ImagickDraw::getTextUnderColor() - Returns the text under color
- Функция ImagickDraw::getVectorGraphics() - Returns a string containing vector graphics
- Функция ImagickDraw::line() - Draws a line
- Функция ImagickDraw::matte() - Paints on the image's opacity channel
- Функция ImagickDraw::pathClose() - Adds a path element to the current path
- Функция ImagickDraw::pathCurveToAbsolute() - Draws a cubic Bezier curve
- Функция ImagickDraw::pathCurveToQuadraticBezierAbsolute() - Draws a quadratic Bezier curve
- Функция ImagickDraw::pathCurveToQuadraticBezierRelative() - Draws a quadratic Bezier curve
- Функция ImagickDraw::pathCurveToQuadraticBezierSmoothAbsolute() - Draws a quadratic Bezier curve
- Функция ImagickDraw::pathCurveToQuadraticBezierSmoothRelative() - Draws a quadratic Bezier curve
- Функция ImagickDraw::pathCurveToRelative() - Draws a cubic Bezier curve
- Функция ImagickDraw::pathCurveToSmoothAbsolute() - Draws a cubic Bezier curve
- Функция ImagickDraw::pathCurveToSmoothRelative() - Draws a cubic Bezier curve
- Функция ImagickDraw::pathEllipticArcAbsolute() - Draws an elliptical arc
- Функция ImagickDraw::pathEllipticArcRelative() - Draws an elliptical arc
- Функция ImagickDraw::pathFinish() - Terminates the current path
- Функция ImagickDraw::pathLineToAbsolute() - Draws a line path
- Функция ImagickDraw::pathLineToHorizontalAbsolute() - Draws a horizontal line path
- Функция ImagickDraw::pathLineToHorizontalRelative() - Draws a horizontal line
- Функция ImagickDraw::pathLineToRelative() - Draws a line path
- Функция ImagickDraw::pathLineToVerticalAbsolute() - Draws a vertical line
- Функция ImagickDraw::pathLineToVerticalRelative() - Draws a vertical line path
- Функция ImagickDraw::pathMoveToAbsolute() - Starts a new sub-path
- Функция ImagickDraw::pathMoveToRelative() - Starts a new sub-path
- Функция ImagickDraw::pathStart() - Declares the start of a path drawing list
- Функция ImagickDraw::point() - Draws a point
- Функция ImagickDraw::polygon() - Draws a polygon
- Функция ImagickDraw::polyline() - Draws a polyline
- Функция ImagickDraw::pop() - Destroys the current ImagickDraw in the stack, and returns to the previously pushed ImagickDraw
- Функция ImagickDraw::popClipPath() - Terminates a clip path definition
- Функция ImagickDraw::popDefs() - Terminates a definition list
- Функция ImagickDraw::popPattern() - Terminates a pattern definition
- Функция ImagickDraw::push() - Clones the current ImagickDraw and pushes it to the stack
- Функция ImagickDraw::pushClipPath() - Starts a clip path definition
- Функция ImagickDraw::pushDefs() - Indicates that following commands create named elements for early processing
- Функция ImagickDraw::pushPattern() - Indicates that subsequent commands up to a ImagickDraw::opPattern() command comprise the definition of a named pattern
- Функция ImagickDraw::rectangle() - Draws a rectangle
- Функция ImagickDraw::render() - Renders all preceding drawing commands onto the image
- ImagickDraw::resetVectorGraphics
- Функция ImagickDraw::rotate() - Applies the specified rotation to the current coordinate space
- Функция ImagickDraw::roundRectangle() - Draws a rounded rectangle
- Функция ImagickDraw::scale() - Adjusts the scaling factor
- Функция ImagickDraw::setClipPath() - Associates a named clipping path with the image
- Функция ImagickDraw::setClipRule() - Set the polygon fill rule to be used by the clipping path
- Функция ImagickDraw::setClipUnits() - Sets the interpretation of clip path units
- Функция ImagickDraw::setFillAlpha() - Sets the opacity to use when drawing using the fill color or fill texture
- Функция ImagickDraw::setFillColor() - Sets the fill color to be used for drawing filled objects
- Функция ImagickDraw::setFillOpacity() - Sets the opacity to use when drawing using the fill color or fill texture
- Функция ImagickDraw::setFillPatternURL() - Sets the URL to use as a fill pattern for filling objects
- Функция ImagickDraw::setFillRule() - Sets the fill rule to use while drawing polygons
- Функция ImagickDraw::setFont() - Sets the fully-specified font to use when annotating with text
- Функция ImagickDraw::setFontFamily() - Sets the font family to use when annotating with text
- Функция ImagickDraw::setFontSize() - Sets the font pointsize to use when annotating with text
- Функция ImagickDraw::setFontStretch() - Sets the font stretch to use when annotating with text
- Функция ImagickDraw::setFontStyle() - Sets the font style to use when annotating with text
- Функция ImagickDraw::setFontWeight() - Sets the font weight
- Функция ImagickDraw::setGravity() - Sets the text placement gravity
- ImagickDraw::setResolution
- Функция ImagickDraw::setStrokeAlpha() - Specifies the opacity of stroked object outlines
- Функция ImagickDraw::setStrokeAntialias() - Controls whether stroked outlines are antialiased
- Функция ImagickDraw::setStrokeColor() - Sets the color used for stroking object outlines
- Функция ImagickDraw::setStrokeDashArray() - Specifies the pattern of dashes and gaps used to stroke paths
- Функция ImagickDraw::setStrokeDashOffset() - Specifies the offset into the dash pattern to start the dash
- Функция ImagickDraw::setStrokeLineCap() - Specifies the shape to be used at the end of open subpaths when they are stroked
- Функция ImagickDraw::setStrokeLineJoin() - Specifies the shape to be used at the corners of paths when they are stroked
- Функция ImagickDraw::setStrokeMiterLimit() - Specifies the miter limit
- Функция ImagickDraw::setStrokeOpacity() - Specifies the opacity of stroked object outlines
- Функция ImagickDraw::setStrokePatternURL() - Sets the pattern used for stroking object outlines
- Функция ImagickDraw::setStrokeWidth() - Sets the width of the stroke used to draw object outlines
- Функция ImagickDraw::setTextAlignment() - Specifies a text alignment
- Функция ImagickDraw::setTextAntialias() - Controls whether text is antialiased
- Функция ImagickDraw::setTextDecoration() - Specifies a decoration
- Функция ImagickDraw::setTextEncoding() - Specifies specifies the text code set
- ImagickDraw::setTextInterlineSpacing
- ImagickDraw::setTextInterwordSpacing
- ImagickDraw::setTextKerning
- Функция ImagickDraw::setTextUnderColor() - Specifies the color of a background rectangle
- Функция ImagickDraw::setVectorGraphics() - Sets the vector graphics
- Функция ImagickDraw::setViewbox() - Sets the overall canvas size
- Функция ImagickDraw::skewX() - Skews the current coordinate system in the horizontal direction
- Функция ImagickDraw::skewY() - Skews the current coordinate system in the vertical direction
- Функция ImagickDraw::translate() - Applies a translation to the current coordinate system
Коментарии
<?php
// Draw a simple rectangle or three for the newbies.
// I'm trying to comment these as best I can for a non-OOP person.
// commets or criticism are welcome. Gary Melander
$image = new Imagick(); // Create a new instance an $image class
$width = 600; // Some necessary dimensions
$height = 400;
// $image class now inherits some attributes. i.e. Dimensions, bkgcolor...
$image->newImage( $width, $height, new ImagickPixel( 'lightgray' ) );
$draw = new ImagickDraw(); //Create a new drawing class (?)
$draw->setFillColor('wheat'); // Set up some colors to use for fill and outline
$draw->setStrokeColor( new ImagickPixel( 'green' ) );
$draw->rectangle( 100, 100, 200, 200 ); // Draw the rectangle
// Lets draw another
$draw->setFillColor('navy'); // Set up some colors to use for fill and outline
$draw->setStrokeColor( new ImagickPixel( 'yellow' ) );
$draw->setStrokeWidth(4);
$draw->rectangle( 150, 225, 350, 300 ); // Draw the rectangle
// and another
$draw->setFillColor('magenta'); // Set up some colors to use for fill and outline
$draw->setStrokeColor( new ImagickPixel( 'cyan' ) );
$draw->setStrokeWidth(2);
$draw->rectangle( 380, 100, 400, 350 ); // Draw the rectangle
$image->drawImage( $draw ); // Apply the stuff from the draw class to the image canvas
$image->setImageFormat('jpg'); // Give the image a format
header('Content-type: image/jpeg'); // Prepare the web browser to display an image
echo $image; // Publish it to the world!
//$image->writeImage('someimage.jpg"); // ...Or just write it to a file...
?>