D
_DD
It seems that there is some odd interaction with LinearGradientBrush
that depends on positioning. A simple test:
---------
Rectangle Square = new Rectangle(.....);
in Paint:
LinearGradientBrush ShadeBrush = new LinearGradientBrush(
Square, Color.White, Color.Black, 90.0F, true);
g.FillRectangle(ShadeBrush, Square);
---------
This should draw a rectangle with White at the top, blending into
Black at the bottom.
This sometimes works as expected, but sometimes draws a one-
pixel BLACK line across the top edge.
Since the same rect is used for the gradient and for the Fill, you'd
think that nothing could go wrong here. Any ideas?
PS: To top it off, It seems position-sensitive. Changing the Y
position of the Square can cause this wto work correctly.
Also changing the vertical size of the Square object can make thiis
display correctly.
that depends on positioning. A simple test:
---------
Rectangle Square = new Rectangle(.....);
in Paint:
LinearGradientBrush ShadeBrush = new LinearGradientBrush(
Square, Color.White, Color.Black, 90.0F, true);
g.FillRectangle(ShadeBrush, Square);
---------
This should draw a rectangle with White at the top, blending into
Black at the bottom.
This sometimes works as expected, but sometimes draws a one-
pixel BLACK line across the top edge.
Since the same rect is used for the gradient and for the Fill, you'd
think that nothing could go wrong here. Any ideas?
PS: To top it off, It seems position-sensitive. Changing the Y
position of the Square can cause this wto work correctly.
Also changing the vertical size of the Square object can make thiis
display correctly.