H
Halimaji Nijazi
Hi
For viewing pictures I am using a pictures box... For making proper saving
of the pic, I must delete an existing pic-file and overwrite it with the
picture in the picturebox... Trying this I always get an exeption, that the
file is in use... This is my code...
'remarks
Imports System.IO
Imports System.Drawing
'
Dim mytempic as String= "X:\Photos\MyTempPic1.jpg"
If System.Io.File.Exists(mytempic) = False Then
Me.pboPicture.Image.Save(mytempPic)
Else
Dim tempPic As String = "X:\Photos\tmp.jpg"
Me.pboPicture.Image.Save(tempPic)
Me.pboPicture.Image = Image.FromFile(tempPic)
'The error occurs here, but I cleared the picturebox
File.Delete(mytemppic)
Me.pboPicture.Image.Save(mytempic)
'other way to load the picture
Me.pboPicture.ImageLocation = mytempic
Me.pboPicture.Load()
End If
end if
If anyone has an idea, please write... I tried everything and didn't get it
work...
Thanks alot
Nijazi Halimaji
For viewing pictures I am using a pictures box... For making proper saving
of the pic, I must delete an existing pic-file and overwrite it with the
picture in the picturebox... Trying this I always get an exeption, that the
file is in use... This is my code...
'remarks
Imports System.IO
Imports System.Drawing
'
Dim mytempic as String= "X:\Photos\MyTempPic1.jpg"
If System.Io.File.Exists(mytempic) = False Then
Me.pboPicture.Image.Save(mytempPic)
Else
Dim tempPic As String = "X:\Photos\tmp.jpg"
Me.pboPicture.Image.Save(tempPic)
Me.pboPicture.Image = Image.FromFile(tempPic)
'The error occurs here, but I cleared the picturebox
File.Delete(mytemppic)
Me.pboPicture.Image.Save(mytempic)
'other way to load the picture
Me.pboPicture.ImageLocation = mytempic
Me.pboPicture.Load()
End If
end if
If anyone has an idea, please write... I tried everything and didn't get it
work...
Thanks alot
Nijazi Halimaji