CreatePen

The CreatePen function creates a pen that has the specified style, width, and color. The pen is used to draw lines and curves.

CreatePen sStyle, nWidth, nColor

Parameters

sStyle
String specifying the pen style. Must be one of the following styles:
StringMeaning
"PS_SOLID" Solid pen
"PS_NULL" Pen is invisible
"PS_DASH" Pen is dashed. This style is valid only when the pen width is one pixel.
"PS_DOT" Pen is dotted. This style is valid only when the pen width is one pixel.
"PS_DASHDOT" Pen has alternating dashes and dots. This style is valid only when the pen width is one pixel.
"PS_DASHDOTDOT" Pen has alternating dashes and double dots. This style is valid only when the pen width is one pixel.
"PS_INSIDEFRAME" Pen is solid. When this pen is used in any drawing function that takes a bounding rectangle, the dimensions of the figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen.

nWidth
Specifies the width of the pen, in pixels.

nColor
Specifies the color for the pen.

Remarks

If the value specified by nWidth is greater than 1, the sStyle parameter must be PS_NULL, PS_SOLID, or PS_INSIDEFRAME

Example
View result

<%@ Language=VBScript %>
<%
Response.ContentType="image/gif"
set obj=Server.CreateObject("shotgraph.image")

size=401
obj.CreateImage size,size,4
obj.SetColor 0,255,255,255
obj.SetColor 1,0,0,0
obj.SetColor 2,0,0,204
obj.SetColor 3,0,204,0
obj.SetBgColor 0
obj.FillRect 0,0,size-1,size-1

obj.CreatePen "PS_SOLID",3,1
obj.Rectangle 100,100,size-101,size-101
obj.CreatePen "PS_DOT",1,1
obj.SetBgColor 3
obj.Rectangle 10,10,size/2,size/2

img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>