示例#1
0
 private void AddGradientStop(GradientStop gradientStop)
 {
     ListViewItem lvi = new ListViewItem();
     lvi.Text = string.Format(" {0:0.##}%", gradientStop.Location);
     lvi.BackColor = gradientStop.Color;
     lvi.ForeColor = ColorHelpers.VisibleTextColor(gradientStop.Color);
     lvi.Tag = gradientStop;
     lvGradientPoints.Items.Add(lvi);
 }
示例#2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     Color color = cbtnCurrentColor.Color;
     float offset = (float)(nudLocation.Value / 100);
     GradientStop gradientStop = new GradientStop(color, offset);
     Gradient.Colors.Add(gradientStop);
     AddGradientStop(gradientStop);
     UpdatePreview();
 }