Пример #1
0
 void OnButtonClick()
 {
     ImagePickerDialog.Launch((string)editor.data ?? "", null, (success, imageId) =>
     {
         if (success)
         {
             editor.SetData(imageId);
             onValueChanged?.Invoke(imageId);
         }
     });
 }
Пример #2
0
        private void ImagePickerButton_Click(object sender, System.EventArgs e)
        {
            var result = ImagePickerDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                try
                {
                    BackgroundPreviewPanel.BackgroundImage = Bitmap.FromFile(ImagePickerDialog.FileName);
                }

                catch (Exception)
                {
                    MessageBox.Show("Could not open image file.", "Error", MessageBoxButtons.OK);
                }
            }
        }