Click here to Skip to main content
16,011,647 members
Home / Discussions / C#
   

C#

 
QuestionNHibernate.AssertionFailure Pin
KrIstOfK10-May-06 23:03
KrIstOfK10-May-06 23:03 
QuestionPlaying video from stream Pin
shadow0110-May-06 22:38
shadow0110-May-06 22:38 
AnswerRe: Playing video from stream Pin
NaNg1524111-May-06 2:37
NaNg1524111-May-06 2:37 
AnswerRe: Playing video from stream Pin
shadow0111-May-06 3:06
shadow0111-May-06 3:06 
QuestionListBox ValueMember Pin
adityap10-May-06 21:21
adityap10-May-06 21:21 
AnswerRe: ListBox ValueMember Pin
rah_sin10-May-06 23:23
professionalrah_sin10-May-06 23:23 
QuestionRe: ListBox ValueMember Pin
adityap10-May-06 23:54
adityap10-May-06 23:54 
QuestionFile lock problem with Image.FromFile() Pin
Stefan Spenz10-May-06 21:18
Stefan Spenz10-May-06 21:18 
Hi,

when I load an image using this

Bitmap bitmap = (Bitmap)Image.FromFile(pic.Path),

it is not possible to delete the file afterwards, unless you exit the program. I tried to call .Dispose() on the object, but it seems like a bug in the FromFile method.

I found out a workaround

Bitmap origbmp = new Bitmap(pic.Path);<br />
Bitmap bitmap = new Bitmap(origbmp);<br />
origbmp.Dispose();
.

I keep working with the copy of the original bitmap as it's not locked anymore.

But, loading an image using Bitmap's constructor, it's impossible to load animated GIFs as it seems that Bitmap doesn't support them.

Now, how can I use animated GIFs and other image formats AND be able to delete the file afterwards?

Thx Big Grin | :-D

Stefan
GeneralRe: File lock problem with Image.FromFile() Pin
Guffa10-May-06 21:36
Guffa10-May-06 21:36 
AnswerRe: File lock problem with Image.FromFile() Pin
Dave Kreskowiak11-May-06 3:41
mveDave Kreskowiak11-May-06 3:41 
GeneralRe: File lock problem with Image.FromFile() Pin
Stefan Spenz11-May-06 4:12
Stefan Spenz11-May-06 4:12 
Questionhow to implement Audio/video chatting using remoting concept in c#.net Pin
deepak__sharma10-May-06 21:06
deepak__sharma10-May-06 21:06 
QuestionIP problem Pin
haseeb_saeed10-May-06 20:40
haseeb_saeed10-May-06 20:40 
AnswerRe: IP problem Pin
albCode10-May-06 20:51
albCode10-May-06 20:51 
AnswerRe: IP problem Pin
Guffa10-May-06 22:56
Guffa10-May-06 22:56 
QuestionMultiple Icons in Icon File Pin
redfish3410-May-06 18:45
redfish3410-May-06 18:45 
AnswerRe: Multiple Icons in Icon File Pin
DigitalKing10-May-06 20:30
DigitalKing10-May-06 20:30 
GeneralRe: Multiple Icons in Icon File Pin
redfish3421-May-06 12:08
redfish3421-May-06 12:08 
Questionhow to protect usb disc by password ? Pin
Veelone10-May-06 16:56
Veelone10-May-06 16:56 
QuestionIs there any Win32 API can change windows logon password? Pin
Veelone10-May-06 16:55
Veelone10-May-06 16:55 
Questionhow to disable usb disk Pin
Veelone10-May-06 16:53
Veelone10-May-06 16:53 
AnswerRe: how to disable usb disk Pin
alexey N10-May-06 17:36
alexey N10-May-06 17:36 
QuestionText file Sorting. Pin
jrbvillanueva10-May-06 16:36
jrbvillanueva10-May-06 16:36 
QuestionRe: Text file Sorting. Pin
DigitalKing10-May-06 20:23
DigitalKing10-May-06 20:23 
AnswerRe: Text file Sorting. Pin
Guffa10-May-06 21:32
Guffa10-May-06 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.