예제 #1
0
        public void CaptureRegion()
        {
            FrmSelect select = new FrmSelect(Screen.FromPoint(Cursor.Position));

            select.ShowDialog();

            if (select.DialogResult == DialogResult.OK)
            {
                BeginWork(() =>
                {
                    Uploader.ImgurUpload(
                        ScreenShotter.CaptureRegion(
#pragma warning disable CS1690 // Accessing a member on a field of a marshal-by-reference class may cause a runtime exception
                            select.Selected.X,
                            select.Selected.Y,
                            select.Selected.Width,
                            select.Selected.Height
#pragma warning restore CS1690 // Accessing a member on a field of a marshal-by-reference class may cause a runtime exception
                            )
                        ).Handle();
                });
            }
        }