Re: image file locked after use

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello, Ted,

I recently ran into a similar problem. I learned that there was a "feature" of GDI+ that keeps the source file locked after the image is loaded.

See "http://support.microsoft.com/?id=814675"; for details and work-arounds.

Cheers,
Randy


thebhone@xxxxxxxxx wrote:

I am creating a website updater program. Currently working on the image

replacement module here.

For some reason, after an image (say /images/1.jpg) has been
used/opened in the application. I cannot later overwrite it (during the

application), even after i have closed it.


"My.Computer.FileSystem.CopyFile(OpenFileDialog1.FileName,
"\images\posters\" & Me.imagenum & ".jpg", True)"


The process cannot access the file 'C:...\images\posters\1.jpg' because

it is being used by another process.


Is there a way to unload this image so that I can overwrite it? As soon

as my application quits, the lock is removed. I can tell that my
program is locking the file, but the image is not being displayed or
used at that time!!


Form3.PictureBox1.Image = System.Drawing.Bitmap.FromFile(imgpath)

is how it is being loaded.


is there a way to unload that? / free up the resource for
editing/deletion.

another way to do what i'm trying?






please help,


Thanks,


Ted

.



Relevant Pages

  • Re: is there any Hard-disk shock-protection for 2.6.18 and above?
    ... Since this feature is actually drive ... forcing an idle immediate with unload feature on a drive which doesn't ... have no idea as to how drives might react if they don't support it. ... +the block layer queue for the specified number of seconds. ...
    (Linux-Kernel)
  • storing more than 300 auto text entries
    ... Great feature, but i can only input 100 entries, then i start to overwrite ... I am creating a directory of faults for an Electrical Company that a ...
    (microsoft.public.word.docmanagement)
  • Re: Quanta upload problem
    ... feature. ... However, when I upload a file, it doesn't overwrite the old ... I saw posted messages relate to Quanta. ...
    (comp.lang.php)
  • Re: Adobe PDF IFilter 6.0 Problems on Windows XP
    ... It crashes when the DLL ... unload. ... Unless you need any specific feature only available in version ...
    (microsoft.public.inetserver.indexserver)
  • Re: Quanta upload problem
    ... mun wrote: ... feature. ... However, when I upload a file, it doesn't overwrite the old ...
    (comp.lang.php)