Beispiel #1
0
        private void btnUploadPicture_Click(object sender, EventArgs e)
        {
            OpenFileDialog open = new OpenFileDialog();

            open.Title  = "Open Picture";
            open.Filter = "jpg files (*.jpg)|*.jpg|All files (*.*)|*.*";

            if (open.ShowDialog() == DialogResult.OK)
            {
                pictureBox1.Image = new Bitmap(open.OpenFile());
                Filename          = open.SafeFileName;
                PictureAdded?.Invoke(sender, e);
            }
            open.Dispose();
        }
    public void AddRefPicture()
    {
        var script = UIController.Instance.ShowRefPicture();

        script.OnAccepted += (text) =>
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                return;
            }
            PictureCanvas canvas = UIController.Instance.ShowPictureCanvas();
            pictures.Add(canvas);
            canvas.SetPicture(text);
            PictureAdded?.Invoke(canvas);
            script.Close();
        };
    }