|
-
May 26th, 2006, 01:10 AM
#1
loading bitmap locks file until dispose?
I am loading a bitmap from a file and using it as the background image of my form.
Code:
string sBitmapFullPath = @"C:\picture.bmp";
Bitmap bm = new Bitmap(sBitmapFullPath);
Color col = bm.GetPixel(1, 1);
this.Width = bm.Width;
this.Height = bm.Height;
this.BackgroundImage = bm;
At some point later I try to modify the file C:\picture.bmp, but the file is locked. After I call Bitmap.Dispose, I can modify the file. Is there any way that I can modify the file while it is still locked? I tried to use Bitmap.Clone image, but that didn't work either. Any ideas?
Basically, I want to change the image used for my form background, but I want it to use the same file path.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|