This article describes the setting method of saving and restoring graphic objects in C# brush pen. Share it for your reference. The details are as follows:
using System; using ; using ; using ; using ; using ; using ; using .Drawing2D; namespace WindowsApplication2 { public partial class Form11 : Form { public Form11() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { LinearGradientBrush brush = new LinearGradientBrush(, , , 100); ColorBlend blend = new ColorBlend(); = new Color[] { , , }; = new float[] { 0, .5f, 1 }; = blend; Pen pen5 = new Pen(brush); Graphics g5 = (); Point[] p = new Point[] { new Point(0, 0), new Point(100, 100), new Point(50, 100), new Point(200, 100) }; GraphicsState old = (); = ; (old); (pen5,p); } } }
I hope this article will be helpful to everyone's C# programming.