Re: image file locked after use
- From: "R. MacDonald" <scitec@xxxxxxxxxxxxxxx>
- Date: Tue, 21 Mar 2006 10:18:35 +0100
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
- References:
- image file locked after use
- From: thebhone
- image file locked after use
- Prev by Date: Re: Number and bit
- Next by Date: Re: How to create a control to do this?...
- Previous by thread: Re: image file locked after use
- Next by thread: Re: image file locked after use
- Index(es):
Relevant Pages
|