En vb2015, ¿cómo escribir el código para tomar capturas de pantalla a través de un área de captura de pantalla definida por el usuario (como qq)?
¿Público?Clase?Form2
¿Privado?Sub?Form2_MouseDoubleClick(ByVal?sender?As?Object, ByVal?e?As?System.Windows.Forms.MouseEventArgs)?Dim? img?Como?Nuevo?Bitmap(oldRect.Width,?oldRect.Height)
Graphics.FromImage(img).CopyFromScreen(oldRect.X,?oldRect.Y,?0,?0,?oldRect .Size)
img.Save("c:\cutimg.jpg",?Imaging.ImageFormat.Jpeg)
Process.Start("c:\cutimg.jpg")
¿Fin?Si
Fin?Sub
¿Dim?startPoint?As?Point
Dim?curRect?As?Rectangle p> p>
Público?oldRect?As?Rectangle
Dim?onRect?As?Boolean
Privado?Sub?Form2_MouseDown(ByVal?sender?As?Object, ByVal ?e ?As?System.Windows.Forms.MouseEventArgs)?Handles?Me.MouseDown
If?e.Button?=?Windows.Forms.MouseButtons.Left?Then
onRect= True
startPoint=e.Location
End If
End Sub
Privado?Sub?Form2_MouseMove(ByVal?sender? ¿Como?Objeto)?Como?Objeto, ByVal?e?As?System.Windows.Forms.MouseEventArgs) Handle Me.MouseMove
Si?onRect?Entonces
Usando?Gr? ¿Como?Gráficos?=?CreateGraphics()
Si?oldRect?<>?¿Nada?Entonces
ControlPaint.DrawReversibleFrame(oldRect,?Me.BackColor,?FrameStyle.Thick)
¿Fin?Si
curRect?=?Rectangle.FromLTRB(startPoint.X,?Then
ControlPaint.DrawReversibleFrame(curRect,?Me.BackColor,?FrameStyle .Grueso )
Si
curRect.Width?>?0?Si
Fin?Usando
Fin?Si
Fin?Sub
Privado?Sub?Form2_MouseUp(ByVal?sender?As?Object,ByVal?e?As?System .Windows.Forms.MouseEventArgs)?Handles?Me.MouseUp p>
onRect?=?False
Fin?Sub
Privado?Sub?F
orm2_Load(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?MyBase.Load
oldRect?=?Nada
¿Fin? Sub
Public?Sub?New()
'?Esta llamada es requerida por el Diseñador de Windows Forms.
InitializeComponent()
'? Agregar cualquier inicialización después de llamar a "InitializeComponent()". Agregue cualquier inicialización después de la llamada.
ShowInTaskbar?=?False
Texto?=?""
ControlBox?=?False
TopMost?=?True
WindowState?=?FormWindowState.Maximized
Opacidad?=?0.3
¿Fin?