Drawing Simple Lines and Shapes (ASP - JavaScript)
The following example demonstrates how to draw lines and shapes on the bitmap:
<%@ Language=JavaScript %>
<%
var DRAWPENSTYLE_SOLID = 0;
var DRAWMODE_COPY_PEN = 13;
var DRAWFILLSTYLE_HORIZONTAL_LINE = 2;
var FILE_JFIF = 10;
var RasterObj = Server.CreateObject("LEADRaster.LEADRaster");
var RasterIO = Server.CreateObject("LEADRasterIO.LEADRasterIO");
var RasterFxd = Server.CreateObject("LEADRasterFxd.LEADRasterFxd");
RasterIO.Load(RasterObj, "i:\\a\\pic\\20020816demo3.jpg", 0, 0, 1);
//Set the drawing style.
RasterFxd.DrawPenStyle = DRAWPENSTYLE_SOLID;
RasterFxd.DrawPenWidth = 2;
RasterFxd.DrawPenColor = 255; //Red
RasterFxd.DrawMode = DRAWMODE_COPY_PEN;
RasterFxd.DrawFillColor = 65280; //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'>");
%>