private void OnMouseUp(object sender, MouseEventArgs e) { TextDialog textDlg = new TextDialog(); if (textDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Graphics g = Graphics.FromImage(args.bitmap); g.DrawString(textDlg.ReturnText, textDlg.TextFont, GetBrush(false), e.Location); args.pictureBox.Invalidate(); } }
public override void OnMouseDown(object sender, MouseEventArgs e) { TextDialog textDialog = new TextDialog(); DialogResult dialogResult = textDialog.ShowDialog(); if (dialogResult == DialogResult.OK) { CanvasView canvasView = sender as CanvasView; _point = canvasView.GetBitmapLocation(e.Location); Canvas canvas = canvasView.Canvas; Font font = new Font(_fontFamily, Size); canvas.DrawText(textDialog.Text, font, Color, _point); } }