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


ASPPainter::Blend::BlendingImageSample.vbs

							
'============================================================
'Sample BlendingImageSample.vbs

' This sample shows how the text output quality is changing, depending 
' on SetBlendingMode and SetBlendingQuality parameters. The BlendImage 
' method gives a possibility to set the quality if blending.
'
' It can be seen that the image created with Copy method doesn't blend 
' according to alpha channel values. The usage of BlendImage method let 
' you get a better blending quality. 
'============================================================

Set im = CreateObject("ASPPainter.Pictures.1")
width = 100
height = 100
im.SetImageIndex 0
im.SetBKColor 255,255,255,255
im.Create width, height
im.SetColor 127,127,127,255
im.SetColorIndex 1
im.SetColor 127,127,255,255
im.SetGradient 0,0, width,height
im.DrawFilledRectangle 0,0,width,height
im.SetImageIndex 1
im.LoadFile "C:\blend.png"
' Set Blending
im.SetBlendingMode 1
im.SetBlendingQuality 3


im.BlendImage 0,1,0,0,0,0,width,height


im.SetImageIndex 0
im.SetFormat 1
im.SaveToFile "c:\blendimage.jpg"

'Copy
im.SetImageIndex 2
im.SetBKColor 255,255,255,255
im.Create width, height
im.SetColor 127,127,127,255
im.SetColorIndex 1
im.SetColor 127,127,255,255
im.SetGradient 0,0, width, height
im.DrawFilledRectangle 0,0, width, height
im.SetImageIndex 3
im.LoadFile "C:\blend.png"
im.Copy 2,3,0,0,0,0,width,height
im.SetImageIndex 2
im.SaveToFile "c:\copyimage.jpg"

im.Destroy
im.SetImageIndex 1
im.Destroy
im.SetImageIndex 2
im.Destroy
im.SetImageIndex 3
im.Destroy
im.DestroyAll
Set im = nothing
Picture 1.
blend.png
Picture 2.
blendimage.jpg
Picture 3.
copyimage.jpg

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