The vbs script calls the WIA. Vector object to draw a bitmap.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.