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


ASPPainter::Color::ChangeColor.vbs

							
'============================================================
'Sample ChangeColorSample.vbs

' This sample shows how to change one color on another one, and how to change 
' a transparent color. For viewing convenience the transparent color on the page
' is changed to not transparent. '============================================================
Dim pic
Set pic = CreateObject("ASPPAinter.Pictures.1")
pic.SetBKColor 0,0,0,0
pic.Create 100,100

pic.SetColor 0,0,255,255
pic.SetLineWidth 10
pic.DrawRectangle 10,10,50,50
pic.SetColor 0,255,255,255
pic.DrawFilledRectangle 80,80,90,90
pic.SetColorIndex 0
pic.SetColor 0,255,255,255
pic.SetColorIndex 1
pic.SetColor 255,0,0,255

pic.saveToFile "C:\ChangeColor1.png"

pic.ChangeColor 0,1

pic.saveToFile "C:\ChangeColor2.png"

pic.SetColorIndex 1
pic.SetColor 0,0,0,0
pic.SetColorIndex 2

pic.SetColor 255,255,255,0

pic.saveToFile "C:\ChangeTransparentColor1.png"

pic.ChangeTransparentColor 1,2

pic.saveToFile "C:\ChangeTransparentColor2.png"

pic.DestroyALL
Set pic = Nothing
Picture 1.
ChangeColor1.png
Picture 2.
ChangeColor2.png
Picture 3.
ChangeTransparentColor1.png
Picture 4.
ChangeTransparentColor2.png

More samples:

Arc, Beziers, Circle, Ellipse, Line, Pie, Rectangle, Unclosed polygon

See also:

SetHTMLColor, SetBKColor, Create, SetColor , SetLineWidth , DrawArc , DrawFilledRectangle , DrawBezier , DrawCircle , DrawFilledCircle , DrawEllipse , DrawFilledEllipse , DrawRectangle , DrawUnclosedPolygon , SaveToFile , DestroyALL



home samples purchase documentation download