Name

rectangle( ) — draw a rectangle

Synopsis

GD::Image::rectangle(x1, y1, x2, y2, colorindex)

The rectangle( ) method draws a rectangle with its upper left corner at x1, y1 and its lower right corner at x2, y2. The colorindex parameter can be one of the following:

A color index

The lines of the rectangle will be drawn in the specified color. If the color has been marked as transparent, the pixels will become transparent.

gdBrushed

The lines of the rectangle will be drawn using the current brush shape, set with setBrush( ). To create rectangles with sides thicker than one pixel, use a brush of the desired thickness.

gdStyled

The lines of the rectangle will be drawn with dashes defined by a previous call to setStyled( ).

gdStyledBrushed

The lines of the rectangle will be drawn with the current brush but only for those pixels that are not set to gdTransparent within the current gdStyledcolor list.

Get Programming Web Graphics with Perl and GNU Softwar now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.