
本文共 6546 字,大约阅读时间需要 21 分钟。
������ QQ���������������������������������������������������������������������������������������������������QQ���������������������������������������������������������������������������QQ������������������������������������������������������������������������������������������������������������������
������������������������������������������������������WPF���������������������������������������������������������������MFC���winform������������������������������������������������������������������������low������������WPF���������������������������������������������������������������������������������������������������������������������������������������������������
������ ��������������������������� ���������������������������������������������������QQ������920519255���
������������������������ ���������������������������������������������������������������������
���������������1������������������������������������������������������������������������2������������+���������������������������������������������������������������
���������������������������
������������������������
���������������������������������������������������������������������������
���������������
��������������������������������������������������������������������������������� ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������
public Bitmap GetScreenSnapshot() { System.Drawing.Rectangle rc = SystemInformation.VirtualScreen; var bitmap = new Bitmap(rc.Width, rc.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); using (Graphics memoryGrahics = Graphics.FromImage(bitmap)) { memoryGrahics.CopyFromScreen(rc.X, rc.Y, 0, 0, rc.Size, CopyPixelOperation.SourceCopy); } return bitmap; }
������������������
������������������������������������������������������������
������������
���������������������������������������������������������������������������������������������������������������winform������������������������
���������������������������winform���������������������������������������������������������������wpf���������������winform���������������������wpf���������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������
![]()
![]()
������������������������ ������������������������ ���ESC��������� 1 ��� ��� X
���������������������������������������������������������borderSelect���������
private void ImgScreen_MouseMove(object sender, MouseEventArgs e) { if (!_isMouseDown) return; gridCover.Visibility = Visibility.Visible; //������������������������ Point currentPoint = e.GetPosition(imgScreen); Point borderPoint = e.GetPosition(borderSelect); double xDelta = xDelta_BoderToImgScreen; double yDelta = yDelta_BoderToImgScreen; _rectImgCut = ImageHelper.ToRect(currentPoint, _startPoint); Rect rectBoderCut = ImageHelper.ToRect(new Point(currentPoint.X + xDelta, currentPoint.Y + yDelta), new Point(_startPoint.X + xDelta, _startPoint.Y + yDelta)); //��������������������������� Thickness thickness = new Thickness(rectBoderCut.Left, rectBoderCut.Top, 0, 0); borderSelect.SetValue(FrameworkElement.MarginProperty, thickness); imgCut.SetValue(FrameworkElement.MarginProperty, thickness); thickness = new Thickness(rectBoderCut.Left, 3, 0, 0); txtCutInfo.SetValue(FrameworkElement.MarginProperty, thickness); borderSelect.Width = Math.Abs(_startPoint.X - currentPoint.X); borderSelect.Height = Math.Abs(_startPoint.Y - currentPoint.Y); borderSelect.Visibility = Visibility.Visible; //��������������������� ��������������������������������������������������������������������� imgCut.Source = GetBitmapCut(); Int32Rect imgDestRect = GetCutRect(); txtCutInfo.Text = string.Format($"���:{imgDestRect.Width} ���:{imgDestRect.Height}"); }
���������������������������������������������������������������������������������������wpf������������������������������winform������������������������������������wpf���������������������������������������������������������������������������������������������������������������������������������������
���������������������QQ���������������������������������������������������������������������������QQ������������������������
发表评论
最新留言
关于作者
