duheng
2025-03-21 c0be7c001375f73e2c3b49a1b1d447b6fc297bdd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using DevExpress.XtraEditors;
 
namespace PBS.WinFrmUI.Hydro
{
    public partial class SelectBackgroundImageForm : XtraForm
    {
        public SelectBackgroundImageForm()
        {
            InitializeComponent();
        }
 
        public string PicPath { get; set; }
 
        private void simpleButton2_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }
 
        private void pictureEdit1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "Image Files (*.bmp;*.jpg;*.jpeg;*.png;*.gif)|*.bmp;*.jpg;*.jpeg;*.png;*.gif";
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
 
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                PicPath = openFileDialog.FileName;
                pictureEdit1.Image = Image.FromFile(PicPath);
            }
        }
    }
}