में मल्टी-रंग रैखिक ढाल WinForms में बहु-रंग रैखिक ढाल कैसे बनाएं? System.Drawing.Drawing2D.LinearGradientBrush केवल दो रंगों की अनुमति देता है।WinForms
Q
WinForms
14
A
उत्तर
47
यहाँ के रूप में ही जवाब: WinForms में बहु रंग विकर्ण ढाल Multi-color diagonal gradient in winforms
यह एक छोटा सा उदाहरण
void MainFormPaint(object sender, PaintEventArgs e)
{
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;
// rotate
br.RotateTransform(45);
// paint
e.Graphics.FillRectangle(br, this.ClientRectangle);
}
यहाँ
है परिणाम
आशा है कि यह मदद करता है
है+0
बहुत बढ़िया - यह वही है जो मैं ढूंढ रहा था! आपकी सहायता के लिए धन्यवाद. – ChandlerPelhams
+0
@ChandlerPelhams कोई जांच नहीं – punker76
संबंधित मुद्दे
- 1. WinForms
- 2. WinForms
- 3. WinForms
- 4. WinForms
- 5. WinForms
- 6. WinForms
- 7. WinForms
- 8. WinForms
- 9. Winforms
- 10. Winforms
- 11. WinForms
- 12. Winforms
- 13. WinForms
- 14. WinForms
- 15. WinForms
- 16. WinForms
- 17. WinForms
- 18. Winforms
- 19. Winforms
- 20. Winforms
- 21. WinForms
- 22. WinForms
- 23. WinForms
- 24. Winforms accordion
- 25. मैं Winforms
- 26. सी # Winforms
- 27. Winforms एप्लिकेशन
- 28. क्या WinForms
- 29. WinForms: FormWindowState.Normal
- 30. मैं WinForms
दो ग्रेडियेंट बनाएं, एक afte अन्य आर –