InitClipboard

The InitClipboard method initialize the secondary imagespace: "local clipboard". This function can be called only after, not before, CreateImage calling.

InitClipboard nXSize, nYSize

Parameters

nXSize
Specifies the horizontal size of the clipboard image

nYSize
Specifies the vertical size of the clipboard image

Return Value

This function returns True if successful, otherwise returns False.

Remarks

This function creates an clipboard image and all required resources for its functionality.
Do not mix the Windows Clipboard and ShotGraph's clipboard. ShotGraph, of course, does not touch Windows clipboard anyway. The program allocates its own memory buffer to store additional images. You can use this buffer for drawing images and copy the picture to the main image as many times as necessary.

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,153,0,0
obj.SetColor 3,153,0,153
obj.SetBgColor 0
obj.FillRect 0,0,size-1,size-1

'Create 300x300 clipboard
obj.InitClipboard 300,300
'All drawing operations will be on clipboard
obj.SelectClipboard True
obj.SetBgColor 0
obj.FillRect 0,0,299,299
obj.SetDrawColor 1
obj.Rectangle 0,0,40,40
obj.Line 0,0,40,40
obj.Line 0,40,40,0
obj.SetBgColor 2
obj.ExtFloodFill 5,3,1,"FLOODFILLBORDER"
obj.SetBgColor 3
obj.ExtFloodFill 5,37,1,"FLOODFILLBORDER"
for y=0 to size step 40
	for x=0 to size step 40
		'Copy 40x40 image from clipboard
		obj.Copy x,y,40,40,0,0,"SRCCOPY"
	next
next

img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>