Generally the below code will draw a smooth color fade in a canvas. According to me it will be the fastest. Just have a glance over it:
Code:
dim startcolor as color = &c828282
dim endcolor as color = &cFEFFFE
For x As Integer = 0 to g.height step 5
g.forecolor = rgb( endcolor.red - (endcolor.red-startcolor.red) *x/g.height, _
endcolor.green - (endcolor.green-startcolor.green) *x/g.height, _
endcolor.blue - (endcolor.blue-startcolor.blue) *x/g.height)
g.DrawLine 0,x,g.width,x
g.DrawLine 0,x+1,g.width,x+1
g.DrawLine 0,x+2,g.width,x+2
g.DrawLine 0,x+3,g.width,x+3
g.DrawLine 0,x+4,g.width,x+4
next
Bookmarks