5ICHINA.NET original, respectful knowledge
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 basic knowledge
The instance of the Shotgraph object created by your program has an image space (ImageSpace), and the image space is a data structure created by the Shotgraph object, while the SHOTGRAPH object controls and operates the image data. Therefore, if you want to create or operate image files with SHOTGRAPH, you should create image space.
Created objects have up to two image space. One is the primary imagess, and the other is the secondary image space (Secondary ImageSpace). The primary image space is created by the CreateImage method. In fact, this method can be called in almost all Script scripts. The secondary image space is also called the 'local paste board (local clipboard)' is created by the initclipboard method. The secondary image space is used as a cache to hold the entire image of the image, for example: copy, stretch, transparent, etc. Drawing To use the primary image space and the secondary image space, it is loaded from the existing picture, just use the first image space Gifimage, JPEGIMAGE and other methods.
Step by step
This is the basic function of an image creation: writing text, basic graphics, etc.
First create an object "shotgraph.image". Call the CREATEIMAGE method defines the necessary primary image space size. Readimage. Calls an existing image to the primary image space as a background with the ReadImage method. Call the SetColor method to define the color. The FillRect method is used to clear the image space. Call the necessary method to draw. Call the Gifimage (JPEGIMAGE ETC.) method to write
The 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 will be used for drawingobj.SetDrawColor 1'Drawing the lineobj. Line size-1,0,0, size-1'color 2 Will BE Used for Fillingobj.SetBGColor 2'Draw the big circleobj.ellipse 5, 5, size-6, size-6'color 2 Will Be buy for FillingObj. SetBGColor 3'draw The Small Circoleobj.ellipse 5, (Size-5) / 4, Size / 2, (Size-5) * 3 / 4'create The Image File Named Test.gifobj.gifimage 0,1, "TEST. GIF "code in ASP:
Response.contentType = "image / gif"
Set obj = server.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
IMG = Obj.gifimage (0, 1, "")
Response.binaryWrite IMG
The code in Perl:
$ obj = creteObject ("shotgraph.image")
$ SIZE = 201
$ OBJ-> CreateImage ($ SIZE, $ SIZE, 4)
$ OBJ-> SetColor (0,255,255,255)
$ obj-> setcolor (1, 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")
API Daquan http://www.shotgraph.com/api.htm
Component download address http://www.shotgraph.com/download.htm
Note: If you want to use the full function of Shotgraph, you will have Money, but the basic function should be able to meet most of the needs. Ha ha. . .
See you can see the website http://www.shotgraph.com/