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 16


Merging with a transparent Image.


Merging 2 images

Merge.vbs

Dim im
Set im = CreateObject("ActiveImage.Images.1")
im.SetImageType 1
im.ReadFromFile "c:\rose.jpg"
wrose = im.GetWidth
hrose = im.GetHeight

im.SetImage 1
im.SetImageType 3
im.ReadFromFile "c:\target.gif"
w = im.GetWidth
h = im.GetHeight
x1 = wrose/2 - w/2
y1 = hrose/2 - h/2
im.CopyImageMerge 0,1,CInt(x1),CInt(y1),0,0,w,h,100

im.SetImage 0
im.SetImageType 1
im.WriteToFile "c:\merge.jpg"
im.DestroyImage
im.SetImage 1
im.DestroyImage

Set im = Nothing



 rose.jpg target.gif
 Picture 1. rose.jpg (size - 7 Kb) Picture 2. target.gif (transparent, size - 4 Kb)
 merge.jpg
 Picture 3. megre.jpg (size - 9 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.