For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
CFML Reference / 

ImageSetDrawingStroke

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

Description

Sets the drawing stroke for points and lines in subsequent ColdFusion images.

Returns

Nothing.

Category

Image functions

Function syntax

ImageSetDrawingStroke(name [, attributeCollection])

See also

ImageDrawText, ImageSetAntialiasing, ImageSetBackgroundColor, ImageSetDrawingColor, ImageSetDrawingTransparency, 
IsImageFile

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

name

Required. The ColdFusion image on which this operation is performed.

attributeCollection

Optional. The structure used to specify the line attributes. See the Usage section.

Usage

Use the ImageSetDrawingStroke function to control the line attributes of all subsequent drawing objects in a ColdFusion image. For example, you can use this function to set the drawing stroke to a dash pattern once, and then create a rectangle, two ovals, and five lines with that pattern.If a blank or no attribute structure is passed, the drawing stroke is reset to the default values.

attributeCollection

Element

Description

width

Pen width, which is measured perpendicularly to the pen trajectory.

endcaps

Decoration applied to the ends of unclosed subpaths and dash segments. Subpaths that start and end on the same point are considered unclosed if they do not have a close segment:

  • butt
  • round
  • square

lineJoins

Type of line joins:

  • bevel
  • miter
  • join

miterLimit

The limit to trim a line join that has a mitered join decoration. (Use only when lineJoins = "miter".) A line join is trimmed when the ratio of miter length to stroke width is greater than the miterLimit value. The miter length is the diagonal length of the miter, which is the distance between the inside corner and the outside corner of the intersection. The smaller the angle formed by two line segments, the longer the miter length and the sharper the angle of intersection. The default value is 10.0, which trims all angles less than 11 degrees. Trimming miters converts the decoration of the line join to bevel.

dashArray

An array of numbers that indicates the dash pattern. For example. if dashArray is (8,4), the dash pattern is 8 pixels solid, 4 pixels blank, 8 pixels solid, 4 pixels blank, and so on.

dash_phases

An offset into the dash pattern. For example, a dash_phase of 2, and a dashArray of (8,4) produces the dash pattern of 6 pixels solid, 4 pixels blank, 8 pixels solid, 4 pixels blank, and so on.

Example

Example 1

<!--- This example shows how to create an attribute collection for the ImageSetDrawingStroke function and draws a line with those attributes. 
---> 
<!--- Use the ImageNew function to create a ColdFusion image. ---> 
<cfset myImage=ImageNew("",200,200)> 
<!--- Create an attribute collection to pass to the ImageSetDrawingStroke function. Create a stroke that is 10-pixels wide, has round endcaps, and has a dash pattern of (8,4). ---> 
<cfset attr = StructNew()> 
<cfset attr.width = 2> 
<cfset attr.endcaps = "round"> 
<cfset dashPattern = ArrayNew(1)> 
<cfset dashPattern[1] = 8> 
<cfset dashPattern[2] = 4> 
<cfset attr.dashArray = dashPattern> 
<!--- Apply the attribute collection to the ImageSetDrawingStroke function for the image. ---> 
<cfset ImageSetDrawingStroke(myImage,attr)> 
<!--- Draw a line on the ColdFusion image with the drawing stroke attributes. ---> 
<cfset ImageDrawLine(myImage,20,20,40,150)> 
<!--- Display the image in a browser. ---> 
<cfimage source="#myImage#" action="writeToBrowser">

Example 2

<!--- Use the ImageNew function to create a ColdFusion image. ---> 
<cfset myImage=ImageNew("",500,500)> 
<!-- Set the drawing color of the image to cyan. ---> 
<cfset ImageSetDrawingColor(myImage,"cyan")> 
<!--- Draw a line from (30,40) to (200,190). ---> 
<cfset ImageDrawLine(myImage,30,30,200,200)> 
<!--- Create the attribute collection for the drawing stroke. ---> 
<cfset attr = StructNew()> 
<cfset attr.width = 1> 
<cfset attr.endcaps = "round"> 
<cfset dashPattern = ArrayNew(1)> 
<cfset dashPattern[1] = 3> 
<cfset dashPattern[2] = 4> 
<cfset dashPattern[3] = 8> 
<cfset attr.dashArray = dashPattern> 
<!--- Pass the attribute collection as an argument to the set drawing stroke 
function. ---> 
<cfset ImageSetDrawingStroke(myImage,attr)> 
<!-- Set the drawing color of the image to yellow. ---> 
<cfset ImageSetDrawingColor(myImage,"yellow")> 
<!--- Draw a rectangle with the drawing stroke specified. ---> 
<cfset ImageDrawRect(myImage,200,50,210,200)> 
<!-- Reset the drawing stroke. --> 
<cfset ImageSetDrawingStroke(myImage)> 
<!--- Draw a green quadratic curve. ---> 
<cfset ImageSetDrawingColor(myImage,"green")> 
<cfset ImageDrawQuadraticCurve(myImage,120,320,5,15,380,280)> 
<!--- Display the image in a browser. ---> 
<cfimage source="#myImage#" action="writeToBrowser">

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices