Shotgraph can be used in the following environments:
- Visual Basic
- VBScript
- Visual Basic for Applications (VBA), Word, Excel, etc.
- Active Server Pages (ASP) engine with Internet information Server
- Perl for Windows
- Others
Shotgraph
CoolCode:
- Uploading files
- Counter
- Draw an animated GIF graphic
- Draw graphics
Let's start with a simple:
Step by step
- First, establish an object "Shotgraph.image".
- Use the createimage method.
- Use the SetColor method One or more times to define the colors to use for paint.
- Clears all content in your plot, using FillRect generally considered method if necessary.
- Use a valid method for drawing.
- Use the Gifimage function. Your picture is done!
Here is a simple example of how to paint with shotgraph.
The size of the image is 201x201.
Code in VBScript:
' Creating the Objectset obj=createobject ("Shotgraph.image") size=201 ' calling the CreateImage methodobj. CreateImage size,size,4 ' Set 4 colors for drawingobj. SetColor 0,255,255,255obj. SetColor 1,0,0,0obj. SetColor 2,255,108,0obj. SetColor 3,0,0,204 ' crearing the painting area with color 0obj. Setbgcolor 0obj. FillRect 0,0,size-1,size-1 ' Color 0 is used for drawingobj. Setdrawcolor 1 ' Drawing the lineobj. Line Size-1,0,0,size-1 ' Color 2 is used for fillingobj. Setbgcolor 2 ' Draw the big circleobj. Ellipse 5,5,size-6,size-6 ' Color 2 is used for fillingobj. Setbgcolor 3 ' Draw the small circleobj. Ellipse 5, (size-5)/4,SIZE/2, (size-5) *3/4 ' Create the ' image file named Test.gifobj.GifImage 0,1, "test.gif"
The following are the code in ASP and Perl:
Asp
Response.contenttype= "Image/gif" Set Obj=server.createobject ("Shotgraph.image") size=201obj. CreateImage Size,size,4obj. SetColor 0,255,255,255obj. SetColor 1,0,0,0obj. SetColor 2,255,108,0obj. SetColor 3,0,0,204obj. Setbgcolor 0obj. FillRect 0,0,size-1,size-1obj. Setdrawcolor 1obj. Line Size-1,0,0,size-1obj. Setbgcolor 2obj. Ellipse 5,5,size-6,size-6obj. Setbgcolor 3obj. Ellipse 5, (size-5)/4,SIZE/2, (size-5) *3/4img=obj. Gifimage (0,1, "") response.binarywrite img
Perl
$obj =createobject ("Shotgraph.image") $size =201$obj->createimage ($size, $size, 4) $obj->setcolor ( 0,255,255,255) $obj->setcolor (1,0,0,0) $obj->setcolor (2,255,108,0) $obj->setcolor (3,0,0,204) $obj-> Setbgcolor (0) $obj->fillrect (0,0, $size-1, $size-1) $obj->setdrawcolor (1) $obj->line ($size -1,0,0, $size-1) $ Obj->setbgcolor (2) $obj->ellipse (5,5, $size-6, $size-6) $obj->setbgcolor (3) $obj->ellipse (5, ($size-5)/4 , $size/2, ($size-5) *3/4) $obj->gifimage (0,1, "test.gif")