Rectangle

The Rectangle function draws a rectangle. The rectangle is outlined by using the current pen and filled by using the current brush.

Rectangle nXStart, nYStart, nXEnd, nYEnd

Parameters

nXStart
Specifies the x-coordinate of the first base corner of the rectangle

nYStart
Specifies the y-coordinate of the first base corner of the rectangle

nXEnd
Specifies the x-coordinate of the second base corner of the rectangle

nYEnd
Specifies the y-coordinate of the second base corner of the rectangle

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)
%>