The vbs script can call the WIA. Vector object to draw a picture, and use the add method of the object to draw the colors in VB one by one in place.
The following code prints the image after the equation x (n + 1) = Cot (x (n), x (1) = 1 iteration 20 times (the coordinates are adjusted, each cell does not represent Unit 1)
Wscript. echo "computing x (n + 1) = Cot (x (n), x (1) = 1 iteration 20 times" 'sandbox dim V (300,300) 'Initial dim FF = 1' the initial vertex dim Tx, tyfor Tx =-3 to 3 for Ty =-3 to 3 V (50 + Tx, 150 + ty) before Iteration) = 1 nextnextwscript. echo "Initial Value" & F' iteration formula 20 times dim counterfor counter = 1 to 20 F = cos (f)/sin (f) wscript. echo "th" & Counter & "iteration, the value is "& F' sandbox position for Tx =-3 to 3 for Ty =-3 to 3 V (50 + counter * 10 + Tx, 150 + eval (f) * 3 + ty) = 1 next nextwscript. echo "computation completed" 'create WIA object set VE = Createobject ("WIA. vector ") 'plot image dim X, Y, I, JFOR y = 1 to 300 for x = 1 to 300 'plot point if V (x, y) = 1 then ve. add vbred 'vertical axis elseif x = 50 or Y = 150 then ve. add vbblue 'horizontal and vertical coordinate guides elseif x mod 10 = 0 or y MOD 10 = 0 then ve. add vbblack 'White else ve. add vbwhite end if nextnextve. imagefile (300,300 ). saveFile "result.bmp"
Note that do not call the add method of WIA. Vector multiple times under the same coordinate. Otherwise, an exception is thrown during script running.
The following batchcompute command (BAT) script allows you to call the preceding vbs script with one click.
@ECHO OFFCSCRIPT test.vbs //NOLOGOPAUSE
Run the following command:
The image result.bmp is as follows:
End
The vbs script calls the WIA. Vector object to draw a bitmap.