Class Magick::Draw
In: ext/RMagick/rmmain.c
lib/RMagick.rb
Parent: Object

Methods

Constants

ALIGN_TYPE_NAMES = { LeftAlign.to_i => 'left', RightAlign.to_i => 'right', CenterAlign.to_i => 'center'   Thse hashes are used to map Magick constant values to the strings used in the primitives.
ANCHOR_TYPE_NAMES = { StartAnchor.to_i => 'start', MiddleAnchor.to_i => 'middle', EndAnchor.to_i => 'end'
DECORATION_TYPE_NAMES = { NoDecoration.to_i => 'none', UnderlineDecoration.to_i => 'underline', OverlineDecoration.to_i => 'overline', LineThroughDecoration.to_i => 'line-through'
FONT_WEIGHT_NAMES = { AnyWeight.to_i => 'all', NormalWeight.to_i => 'normal', BoldWeight.to_i => 'bold', BolderWeight.to_i => 'bolder', LighterWeight.to_i => 'lighter', }
GRAVITY_NAMES = { NorthWestGravity.to_i => 'northwest', NorthGravity.to_i => 'north', NorthEastGravity.to_i => 'northeast', WestGravity.to_i => 'west', CenterGravity.to_i => 'center', EastGravity.to_i => 'east', SouthWestGravity.to_i => 'southwest', SouthGravity.to_i => 'south', SouthEastGravity.to_i => 'southeast'
PAINT_METHOD_NAMES = { PointMethod.to_i => 'point', ReplaceMethod.to_i => 'replace', FloodfillMethod.to_i => 'floodfill', FillToBorderMethod.to_i => 'filltoborder', ResetMethod.to_i => 'reset'
STRETCH_TYPE_NAMES = { NormalStretch.to_i => 'normal', UltraCondensedStretch.to_i => 'ultra-condensed', ExtraCondensedStretch.to_i => 'extra-condensed', CondensedStretch.to_i => 'condensed', SemiCondensedStretch.to_i => 'semi-condensed', SemiExpandedStretch.to_i => 'semi-expanded', ExpandedStretch.to_i => 'expanded', ExtraExpandedStretch.to_i => 'extra-expanded', UltraExpandedStretch.to_i => 'ultra-expanded', AnyStretch.to_i => 'all'
STYLE_TYPE_NAMES = { NormalStyle.to_i => 'normal', ItalicStyle.to_i => 'italic', ObliqueStyle.to_i => 'oblique', AnyStyle.to_i => 'all'

Public Instance methods

Apply coordinate transformations to support scaling (s), rotation ®, and translation (t). Angles are specified in radians.

Draw a bezier curve.

Invoke a clip-path defined by def_clip_path.

Define the clipping rule.

Define the clip units

Set color in image according to specified colorization rule. Rule is one of point, replace, floodfill, filltoborder,reset

Specify EITHER the text decoration (none, underline, overline, line-through) OR the text solid background color (any color name or spec)

Define a clip-path. A clip-path is a sequence of primitives bracketed by the "push clip-path <name>" and "pop clip-path" primitives. Upon advice from the IM guys, we also bracket the clip-path primitives with "push(pop) defs" and "push (pop) graphic-context".

Let anything through, but the only defined argument is "UTF-8". All others are apparently ignored.

Specify object fill, a color name or pattern name

fill_color(colorspec)

Alias for fill

Specify fill opacity (use "xx%" to indicate percentage)

fill_pattern(colorspec)

Alias for fill

Specify text drawing font

font_size(points)

Alias for pointsize

The font weight argument can be either a font weight constant or [100,200,…,900]

Specify the text positioning gravity, one of: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast

Set matte (make transparent) in image according to the specified colorization rule

Specify drawing fill and stroke opacities. If the value is a string ending with a %, the number will be multiplied by 0.01.

Draw using SVG-compatible path drawing commands. Note that the primitive requires that the commands be surrounded by quotes or apostrophes. Here we simply use apostrophes.

Define a pattern. In the block, call primitive methods to draw the pattern. Reference the pattern by using its name as the argument to the ‘fill’ or ‘stroke’ methods

Set point to fill color.

Specify the font size in points. Yes, the primitive is "font-size" but in other places this value is called the "pointsize". Give it both names.

Return to the previously-saved set of whatever pop(‘graphic-context’) (the default if no arguments) pop(‘defs’) pop(‘gradient’) pop(‘pattern’)

Push the current set of drawing options. Also you can use push(‘graphic-context’) (the default if no arguments) push(‘defs’) push(‘gradient’) push(‘pattern’)

Specify coordinate space rotation. "angle" is measured in degrees

Specify scaling to be applied to coordinate space on subsequent drawing commands.

Specify the object stroke, a color name or pattern name.

Specify if stroke should be antialiased or not

stroke_color(colorspec)

Alias for stroke

Specify a stroke dash pattern

Specify the initial offset in the dash pattern

Specify opacity of stroke drawing color

 (use "xx%" to indicate percentage)
stroke_pattern(colorspec)

Alias for stroke

Specify stroke (outline) width in pixels.

Draw text at position x,y. Add quotes to text that is not already quoted.

Specify text alignment relative to a given point

SVG-compatible version of text_align

Specify if rendered text is to be antialiased.

Specify color underneath text

Specify center of coordinate space to use for subsequent drawing commands.

[Validate]