/// <summary> /// 按照选项展示符号 /// </summary> private void ShowSymbol() { if (CB_size.SelectedItem != null) { pointsymbol.SetColor(btn_color.BackColor); pointsymbol.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(pointsymbol.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 < 9; i++) { PointSymbol newsymbol = new PointSymbol(i + 1); newsymbol.SetColor(Color.Black); newsymbol.Size = 7; Label newlabel = new Label(); Bitmap bit = newsymbol.GetBitmap(); newlabel.Image = bit; newlabel.Size = new Size(60, 60); newlabel.Location = new Point(10 + 80 * (int)(i / 3), 20 + 80 * (int)(i % 3)); SymbolListView.Controls.Add(newlabel); } }