>K [ 1 Q 0 ImageMagick DrawInfo StructureV<> 
H



,ImageMagick DrawInfo Structure

KThe DrawInfo structure is used to support annotating an image using drawing commands.
 .5=2AJE59$
Methods Supporting DrawInfo

Method

#
Description

GetDrawInfo()Allocate new structure with defaults set.
CloneDrawInfo()Copy existing structure, allocating new structure in the process.
DestroyDrawInfo()Deallocate structure, including any members.
DrawImage()Render primitives to image.
J

The members of the DrawInfo structure are shown in the following table.IThe structure is initialized to reasonable defaults by first initializingJthe equivalent members of ImageInfo, and then]initializing the entire structure using GetDrawInfo().
 .K1H33%P35)@;2&J3'HF)F
DrawInfo Structure Members Supporting DrawImage()

Member


Type

#
Description

affineAffineInfoCoordinate transformation (rotation, scaling, and translation).
border_colorPixelPacketBorder color
boxPixelPacketText solid background color.
decorateDecorationTypeText decoration type.
densitychar *Text rendering density in DPI (effects scaling font according to pointsize).E.g. "72x72"
fillPixelPacketObject internal fill (within outline) color.
fontchar *Font to use when rendering text.
gravityGravityTypeText placement preference (e.g. NorthWestGravity).
linewidthdoubleStroke (outline) drawing width in pixels.
pointsizedoubleFont size (also see density).
primitivechar *Space or new-line delimited list of text drawing primitives (e.g "textF100,100 Cockatoo"). See the table Drawing9Primitives for the available drawing primitives.
strokePixelPacketObject stroke (outline) color.
stroke_antialiasunsigned intSet to True (non-zero) to obtain anti-aliased stroke rendering.
text_antialiasunsigned intSet to True (non-zero) to obtain anti-aliased text rendering.
tileImage *Image texture to draw with. Use an image containing a single color1(e.g. a 1x1 image) to draw in a solid color.


7Drawing Primitives

FThe drawing primitives shown in the following table may be supplied asGa space or new-line deliminted list to the primitive member. PrimitivesPwhich set drawing options effect the results from subsequent drawing operations.ISee the 'push graphic-context' and 'pop graphic-context'  primitives8for a way to control the propogation of drawing options.
 .,J&8(&9E/!5'%#O*"F9E"3(9!<((M%6H=//"8812EMS
Drawing Primitives
!
Primitive

!
Arguments


Purpose

affinesx,rx,ry,sy,tx,tyApply coordinate transformations to support scaling (s), rotation (r),Gand translation (t). Angles are specified in radians. Equivalent to SVGBmatrix command which supplies a transformation matrix.
angleangleSpecify object drawing angle.
arcstartX,startY endX,endY startDegrees,endDegreesDraw an arc.
Bezierx1,y1, x2,y2, x3,y3, ..., xN,yNDraw a Bezier curve.
circleoriginX,originY perimX,perimYDraw a circle.
colorx,y (point|replace|floodfill|filltoborder|reset)Set color in image according to specified colorization rule.
decorate(none|underline|overline|line-through)Specify text decoration.
ellipseoriginX,originY width,height arcStart,arcEndDraw an ellipse.
fillcolorspecSpecifiy object filling color.
fill-opacityopacitySpecify object fill opacity.
fontfontnameSpecify text drawing font.
gravity(NorthWest|North|NorthEast|West|Center|East|SouthWest|South|SouthEast)Specify text positioning gravity.
imagex,y width,height filenameComposite image at position, scaled to specified width and height,Rand specified filename. If width or height is zero, scaling is not performed.
line startX,startY endX,endYDraw a line.
mattex,y (point|replace|floodfill|filltoborder|reset)Set matte in image according to specified colorization rule.
opacityfillOpacity strokeOpacitySpecify drawing fill and stroke opacities.
path'SVG-compatible path arguments'Draw using SVG-compatible path drawing commands.
point x,ySet point to fill color.
pointsizepointsizeSpecify text drawing pointsize (scaled to density).
polygonx1,y1, x2,y2, x3,y3, ..., xN,yNDraw a polygon.
polylinex1,y1, x2,y2, x3,y3, ..., xN,yNDraw a polyline.
popgraphic-contextRemove options set since previous "push graphic-context" command. OptionsDrevert to those in effect prior to pushing the graphic context.
pushgraphic-contextSpecify new graphic context.
rectupperLeftX,upperLeftY lowerRightX,lowerRightYDraw a rectangle.
rotateangleSpecify coordiante space rotation. Subsequent objects are drawn with5coordate space rotated by specified angle. 
roundrectanglecenterX,centerY width,hight cornerWidth,cornerHeightDraw a rectangle with rounded corners.
strokecolorspecSpecify object stroke (outline) color.
stroke-antialiasstroke_antialias (0 or 1)Specify if stroke should be antialiased or not.
stroke-dashvalueSpecify pattern to be used when drawing stroke.
stroke-opacityopacitySpecify opacity of stroke drawing color.
stroke-widthlinewidthSpecify stroke (outline) width in pixels.
textx,y "some text"Draw text at position.
text-antialias text_antialias (0 or 1)Specify if rendered text is to be antialiased (blend edges).
scale x,ySpecify scaling to be applied to coordintate space for subsequent drawingcommands.
translate x,ySpecify center of coordinate space to use for subsequent drawing commands.





˜

Home Page9Image manipulation software that works like magic.