private void btn_PaintSearch_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(tb_PaintSearcher.Text) || tb_PaintSearcher.Text.Length < 3) { return; } PaintList.Clear(); foreach (var paint in _gameDB.SearchPaintsByName(tb_PaintSearcher.Text)) { var colorBytes = BitConverter.GetBytes(paint.color); var paintC = new PaintInfo(paint.id, Color.FromRgb(colorBytes[0], colorBytes[1], colorBytes[2]), paint.name); PaintList.Add(paintC); } lv_PaintList.ItemsSource = null; lv_PaintList.ItemsSource = PaintList; }
private void PaintList_MouseMove(object sender, MouseEventArgs e) { if (toolname == "pen") { Graphics g = PaintList.CreateGraphics(); if (draw) { x2 = x1; y2 = y1; x1 = e.X; y1 = e.Y; paint_simple(); } } if (toolname == "line") { if (draw) { x2 = e.X; y2 = e.Y; paint_simple(); } } }
private void NewListButton_Click(object sender, EventArgs e) { PaintList.Refresh(); }
public Form1() { InitializeComponent(); g = PaintList.CreateGraphics(); }