Bitmaps
can be very sticky. Try this and see if it fixes the issue. Try without the GC part and see if the using block are enough - otherwise add the garbage collection calls.
Function GetImage() As String
Dim tempFile As String = Path.GetTempPath() & "Screen_Log.jpg"
Using bmpScreenshot As Bitmap = New Bitmap(Width, Height, PixelFormat.Format32bppArgb)
Using gfxScreenshot As Graphics = Graphics.FromImage(bmpScreenshot)
gfxScreenshot.CopyFromScreen(Me.Location.X, Me.Location.Y, 0, 0, Me.Size, CopyPixelOperation.SourceCopy)
bmpScreenshot.Save(tempFile, ImageFormat.Jpeg)
End Using
End Using
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
Return tempFile
End Function