Hi
I have been writing a small "ribbon" like screensaver program using bezier curves.
It all works fine apart from a couple of colouring routines such as the snippet below.
d1,d2,d3,d4 represent the start, end and control points of the curve.
The formula calculates a couple of distance values and stores them in the xp/yp variables and these values are then used as rgb values.
Dim xp As Integer = Sqrt((d1.X - d4.X) ^ 2 + (d1.Y - d4.Y) ^ 2)
Dim yp As Integer = Sqrt((d2.X - d3.X) ^ 2 + (d2.Y - d3.Y) ^ 2)
mypen.Color = Color.FromArgb(1, xp Mod 255, yp Mod 255, xp + yp Mod 255)
Again the code works fine and produces some nice effects. However the Alpha value set to a value of 1 will cause the "shader" to produce a transparent colour occasionally. i.e the desktop or windows behind my black background will be shown inside the curves.
upping the alpha value cures the problem but causes washed out looking colours rather than the vibrant colours produced with a value of 1.
I have tried changing the forms transparency key and looking for rgb values that match the key then changing them to a near value instead but none of this seems to work. (I may have done something wrong here)
So anyone have any ideas?
[edit]
A picture to show the problem in action :
https://dl.dropboxusercontent.com/u/47121409/umm.jpg[