Public Class Form1 Dim WithEvents Picturebox1 As New PictureBox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Picturebox1.Dock = DockStyle.Fill Me.Picturebox1.Image = New Bitmap("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg") Me.Controls.Add(Picturebox1) End Sub Dim IsDragging As Boolean Dim startPos As Point Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Picturebox1.MouseDown startPos = e.Location IsDragging = True End Sub Dim currentPos As Point Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Picturebox1.MouseMove If IsDragging Then currentPos = e.Location Picturebox1.Invalidate() End If End Sub Dim p As New Pen(Color.Black, 1) Dim selectedRect As Rectangle Private Sub Picturebox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Picturebox1.Paint selectedRect = New Rectangle(startPos, currentPos - startPos) p.DashStyle = Drawing2D.DashStyle.Dash e.Graphics.DrawRectangle(p, selectedRect) End Sub Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Picturebox1.MouseUp If Not IsDragging Then Return End If IsDragging = False Dim img As New Bitmap(selectedRect.Width, selectedRect.Height) Using g As Graphics = Graphics.FromImage(img) g.DrawImage(Me.Picturebox1.Image, New Rectangle(0, 0, img.Width, img.Height), selectedRect, GraphicsUnit.Pixel) End Using Dim f As New Form f.BackgroundImage = img f.BackgroundImageLayout = ImageLayout.None f.ClientSize = img.Size f.Show() End Sub End Class