I have a colored TIF image in a PictureBox. To convert it to grayscale I need to:
(1) free the image from the pictureBox.
(2) move the image from the working folder to a temp folder
(3)use the grayscale subroutine to convert from color in the temp folder to gray in the working folder.
My problem is that Visual Basic will not release the image in the PictureBox
so that I can move it.
Dim fileLeft As String
Dim fileCopy As String
Me.PicBoxLeft.Image = Nothing
{{ free up the image now }}
fileLeft = TNpath + "\" + fileNames(q)
fileCopy = "C:\AuditBook\Temp\" + fileNames(q)
My.Computer.FileSystem.MoveFile(fileLeft, fileCopy, True)
How do I get Visual Basic to free up the image?