If I replace an image in a PictureBox control, should I dispose the original image first? .Net Winfo

Posted by Jules on Stack Overflow See other posts from Stack Overflow or by Jules
Published on 2010-04-10T12:03:27Z Indexed on 2010/04/10 12:13 UTC
Read the original article Hit count: 271

Filed under:
|
|
|
|

Following on from my question here http://stackoverflow.com/questions/2548664/long-overdue-for-me-question-about-disposing-managed-objects-in-net-vb-net ,

If I replace an image in a picture box, should I dispose the original image first?

Or, what about this situation:

Dim bm As New Bitmap(32,32)  
bm = New Bitmap(32,32)  
bm = New Bitmap(32,32)  
bm = New Bitmap(32,32)  

Does bm need only to be disposed at the end, or should it be disposed before each re-creation?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about winforms