Guten Morgen,
ich habe vor, einen Farbverlauf mehrerer Farben zu zeichnen.
Grundsätzlich nicht unbedingt schwer:
Das Ergebnis:
![](https://www.vb-paradise.de/index.php/Attachment/51002-multigradient-JPG/?thumbnail=1&s=1cf07e8a30f9165f5b918bd889c916e90df39799)
Allerdings möchte ich, dass es nach oben hin transparent wird, woran ich momentan scheitere.
Ein einfarbiger Verlauf ins Transparente geht auch noch:
![](https://www.vb-paradise.de/index.php/Attachment/50999-gradient-to-transparent-png/?thumbnail=1&s=1cf07e8a30f9165f5b918bd889c916e90df39799)
Was ich eigentlich möchte:
![](https://www.vb-paradise.de/index.php/Attachment/51003-multigradient-to-transparent-png/?s=1cf07e8a30f9165f5b918bd889c916e90df39799)
Ist soetwas mit GDI möglich?
Und wenn ja, wie?
Danke für Eure Ansätze...
ich habe vor, einen Farbverlauf mehrerer Farben zu zeichnen.
Grundsätzlich nicht unbedingt schwer:
C#-Quellcode
- LinearGradientBrush br = new LinearGradientBrush( this.ClientRectangle, Color.Black, Color.Black, 0, false );
- ColorBlend cb = new ColorBlend();
- cb.Positions = new[] { 0, 1 / 6f, 2 / 6f, 3 / 6f, 4 / 6f, 5 / 6f, 1 };
- cb.Colors = new[] { Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Blue, Color.Indigo, Color.Violet };
- br.InterpolationColors = cb;
- //br.RotateTransform( 45 );
- e.Graphics.FillRectangle( br, this.ClientRectangle );
Das Ergebnis:
Allerdings möchte ich, dass es nach oben hin transparent wird, woran ich momentan scheitere.
Ein einfarbiger Verlauf ins Transparente geht auch noch:
Was ich eigentlich möchte:
Ist soetwas mit GDI möglich?
Und wenn ja, wie?
Danke für Eure Ansätze...
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „TRiViUM“ ()