ASP Painter
Home
Home
Samples
Samples
Purchase
Purchase
Download
Download
Documentation
Documentation


ASPPainter Samples

Sample 4 - Copy a part of a transparent image to another image.

Filled rectangles, copying images
 


Dim pic
Set pic = CreateObject("ASPPainter.Pictures.1")


'Set GIF Image type
pic.SetFormat 3
'Load the file
pic.LoadFile "C:\cat.gif"

pic.SetImageIndex 1
'Set Gif image type
'Load image from file
pic.LoadFile "c:\fish.gif"
h = pic.Height
w = pic.Width

'Copy image
pic.Copy 0,1,110,85,0,0,w,h

pic.SetImageIndex 0
r = pic.GetPixelRed(1,1)
g = pic.GetPixelGreen(1,1)
b = pic.GetPixelBlue(1,1)
pic.SetColor r,g,b,255
pic.setColorAsTransparent

pic.SaveToFile "c:\eat.gif"
pic.DestroyAll

Set pic = Nothing


Figure 1. cat.gif(size - 4.4 Kb) Figure 2. fish.gif (size - 2.4 Kb) Figure 3. CatAndFish.gif (size - 6.1 Kb)



home samples purchase documentation download