Tonec.com Bringing Internet Technology Innovations to Market since 1991
  News Products Outsourcing About Us Contact Us
what's new?what's new? featuresfeatures samplessamples manualmanual downloaddownload buybuy
  Tonec Homepage
ProductsActive Imagesamples

Please view complete list of samples

Sample 6


Filled rectanglesand color manipulation


Filled rectangles, color manipulation

rectangle.vbs

Dim im
Set im = CreateObject("ActiveImage.Images.1")
im.CreateImage 170,1200
im.SetColor 255,255,255
im.Fill 0,0
im.SetFont 3 ' Tiny
x = 0
y = 0
d = 8

Dim c(5)
c(0) = 0
c(1) = 63
c(2) = 127
c(3) = 191
c(4) = 255


For r = 0 to 4
For g = 0 to 4
For b = 0 to 4

y = y + d
im.SetColor c(r),c(g),c(b)
im.DrawFilledRectangle x, y, x + 170, y + d
im.SetColor 255 - c(r), 255 - c(g), 255 - c(b)
im.DrawText x,y, "Red = " & im.GetPixelRed(x,y) & " Green = " & im.GetPixelGreen(x,y) & " Blue = " & im.GetPixelBlue(x,y)
next
next
next

im.WriteToFile "C:\rectangle.png"
im.SetImageType 1
im.SetJpegQuality 100
im.WriteToFile "C:\rectangle.jpg"
im.DestroyImage
Set im = Nothing


 rectangle.jpg rectangle.png
 Picture 1. rectangle.jpg (size - 250 Kb) Picture 2. rectangle.png (size - 27 Kb)

Next sample >> 

If you have any questions or bug reports, write to support@tonec.com for technical support.

  TonecPrivacy Policy
  © 1999-2005. Tonec, Inc. All rights reserved.