using DevExpress.XtraEditors;
|
|
namespace PBS.WinFrmUI.Hydro
|
{
|
public partial class SelectBackgroundImageCtrl : XtraUserControl
|
{
|
public SelectBackgroundImageCtrl()
|
{
|
InitializeComponent();
|
}
|
|
/// <summary>
|
/// 回调事件
|
/// </summary>
|
public event EventHandler<SelectBackgroundImageCtrl> ApplyDataEvent;
|
public event EventHandler<SelectBackgroundImageCtrl> ConfirmDataEvent;
|
public event EventHandler CancleEvent;
|
|
public string PicPath { get; set; }
|
/// <summary>
|
/// 底图X
|
/// </summary>
|
public float BackGroundImgX = 0;
|
|
/// <summary>
|
/// 底图Y
|
/// </summary>
|
public float BackGroundImgY = 0;
|
/// <summary>
|
/// 底图高度
|
/// </summary>
|
public float BackGroundImgHeight = 0;
|
/// <summary>
|
/// 底图宽度
|
/// </summary>
|
public float BackGroundImgWidth = 0;
|
/// <summary>
|
/// 底图旋转角度
|
/// </summary>
|
public float BackGroundImgRotaAngle = 0;
|
|
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);
|
}
|
}
|
|
private void simpleButton3_Click(object sender, EventArgs e)
|
{
|
this.BackGroundImgX = float.Parse(textEdit2.Text);
|
this.BackGroundImgY = float.Parse(textEdit3.Text);
|
this.BackGroundImgWidth = float.Parse(textEdit4.Text);
|
this.BackGroundImgHeight = float.Parse(textEdit5.Text);
|
this.ApplyDataEvent?.Invoke(null, this);
|
|
}
|
|
private void simpleButton2_Click(object sender, EventArgs e)
|
{
|
this.CancleEvent?.Invoke(null, null);
|
}
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
{
|
this.BackGroundImgX = float.Parse(textEdit2.Text);
|
this.BackGroundImgY = float.Parse(textEdit3.Text);
|
this.BackGroundImgWidth = float.Parse(textEdit4.Text);
|
this.BackGroundImgHeight = float.Parse(textEdit5.Text);
|
this.ConfirmDataEvent?.Invoke(null, this);
|
}
|
}
|
}
|