void Init() { ColorBlend cb = new ColorBlend(3); Color[] clrs = new Color[3]; clrs[0] = Color.Black; clrs[1] = Color.White; clrs[2] = Color.Black; float[] floats = new float[3]; floats[0] = 0; floats[1] = 0.5f; floats[2] = 1; cb.Colors = clrs; cb.Positions = floats; LinearGradient = new NSLinearGradientBrushInfo(cb, 0); }
public NSLinearGradientBrushInfo Clone() { NSLinearGradientBrushInfo other = new NSLinearGradientBrushInfo(); other.ColorBlend = new ColorBlend(ColorBlend.Colors.Length); for (int i = 0; i < ColorBlend.Colors.Length; i++) { other.ColorBlend.Colors[i] = ColorBlend.Colors[i]; other.ColorBlend.Positions[i] = ColorBlend.Positions[i]; } other.Angle = this.Angle; return(other); }
private void button_linear_add_Click(object sender, EventArgs e) { NSLinearGradientBrushInfo LinearGradientBrushInfo = linearGradientUserControl1.LinearGradientBrushInfo; LinearGradientBrush br = new LinearGradientBrush(ClientRectangle, Color.Red, Color.FromArgb(255, 0, 255, 0), LinearGradientMode.Horizontal); br.InterpolationColors = LinearGradientBrushInfo.ColorBlend; FlowCell cell = new FlowCell(br); Form_Message fm_msg = new Form_Message(); string str = "渐变色" + flowLayoutPanelEx_linear.Controls.Count.ToString(); if (fm_msg.ShowDialog() == DialogResult.OK) { cell.Text = str; flowLayoutPanelEx_linear.Add(cell); } }
private void button_radiate_add_Click(object sender, EventArgs e) { NSLinearGradientBrushInfo LinearGradientBrushInfo = linearGradientUserControl2.LinearGradientBrushInfo; PathGradientBrush br = new PathGradientBrush(_pointsPathBrushExample); br.InterpolationColors = LinearGradientBrushInfo.ColorBlend; FlowCell cell = new FlowCell(br); Form_Message fm_msg = new Form_Message(); string str = "渐变色" + flowLayoutPanelEx_radiate.Controls.Count.ToString(); if (fm_msg.ShowDialog() == DialogResult.OK) { cell.Text = str; flowLayoutPanelEx_radiate.Add(cell); } }
private void Init() { BrushType = NSBrushType.Solid; SolidBrushInfo = new NSSolidBrushInfo(Color.Red); ColorBlend cb = new ColorBlend(2); Color[] clrs = new Color[2]; float[] floats = new float[2]; clrs[0] = Color.White; clrs[1] = Color.Black; floats[0] = 0; floats[1] = 1; cb.Colors = clrs; cb.Positions = floats; LinearGradientBrushInfo = new NSLinearGradientBrushInfo(cb, 0); HatchBrushInfo = new NSHatchBrushInfo(); TextrueBrushInfo = new NSTextrueBrushInfo(); LinearGradientBrush h; HatchBrush global; TextureBrush a; PathGradientBrushInfo = new NSPathGradientBrushInfo(cb); }
public NSPathGradientBrushInfo(ColorBlend cb) { LinearGradient = new NSLinearGradientBrushInfo(cb, 0); }