Drawing Simple Lines and Shapes (ASP - VBScript)
The following example demonstrates how to draw lines and shapes on the bitmap:
<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim RasterObj
Dim RasterIO
Dim RasterFxd
Dim FILE_JFIF
Dim DRAWPENSTYLE_SOLID
Dim DRAWMODE_COPY_PEN
Dim DRAWFILLSTYLE_HORIZONTAL_LINE
DRAWPENSTYLE_SOLID = 0
DRAWMODE_COPY_PEN = 13
DRAWFILLSTYLE_HORIZONTAL_LINE = 2
Set RasterObj = Server.CreateObject("LEADRaster.LEADRaster")
Set RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO")
Set RasterFxd = Server.CreateObject("LEADRasterFxd.LEADRasterFxd")
FILE_JFIF = 10
RasterIO.Load RasterObj, "i:\a\pic\20020816demo3.jpg", 0, 0, 1
'Set the drawing style.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID
RasterFxd.DrawPenWidth = 2
RasterFxd.DrawPenColor = RGB(255, 0, 0) 'Red
RasterFxd.DrawMode = DRAWMODE_COPY_PEN
RasterFxd.DrawFillColor = RGB(0, 255, 0) 'Green
RasterFxd.DrawFillStyle = DRAWFILLSTYLE_HORIZONTAL_LINE
RasterFxd.DrawPersistence = True
'Draw a few shapes on the bitmap
RasterFxd.DrawEllipse RasterObj, 0, 0, 0, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 3
RasterFxd.DrawLine RasterObj, 0, 0, RasterObj.BitmapHeight / 3, RasterObj.BitmapWidth, 2 * RasterObj.BitmapHeight / 3
RasterFxd.DrawRectangle RasterObj, 0, 0, 2 * RasterObj.BitmapHeight / 3, RasterObj.BitmapWidth, RasterObj.BitmapHeight / 3
RasterIO.Save RasterObj, "c:\asp.jpg", FILE_JFIF, 0, 2, 0
Response.Write "<IMG SRC='c:\asp.jpg'>"
%>