/// <summary> /// 按照选项展示符号 /// </summary> private void ShowSymbol() { if (CB_size.SelectedItem != null) { symbol.SetColor(btn_color.BackColor); symbol.Size = (float)Convert.ToDouble(CB_size.SelectedItem.ToString()); } Bitmap newimg = new Bitmap(PB_show.Width, PB_show.Height); Graphics g = Graphics.FromImage(newimg); g.DrawImage(symbol.GetBitmap(), new PointF((PB_show.Width - 48) / 2, (PB_show.Height - 24) / 2)); PB_show.Image = newimg; }
/// <summary> /// 加入图片 /// </summary> private void listview_Load() { for (int i = 0; i < 5; i++) { LineSymbol newsymbol = new LineSymbol(); newsymbol.Style = SetDashStyle(i + 1); newsymbol.SetColor(Color.Black); Label newlabel = new Label(); Bitmap bit = newsymbol.GetBitmap(); newlabel.Image = bit; newlabel.Size = new Size(60, 60); newlabel.Location = new Point(10 + 70 * (int)(i % 5), 10); SymbolListView.Controls.Add(newlabel); } }