[.net] Quick .NET question
Hey I'm fairly new to .NET but luckly I am pretty familer with C++/C# so I so far have been able to guess my way around how to do things until just now. My question is though I have users select a bunch of images and it generates a preview on the fly (example: http://www.stvproductionz.com/images/gallery(4).jpg). But I can't delete the images when the user chooses too. It just deletes the last image generated when I referance it by name. Any ideas? Maybe a way to loop through a list and delete them all? Thanks. This will also be useful for me to learn so I can edit the images. :)
Quote:Original post by doctorhair1
But I can't delete the images when the user chooses too. It just deletes the last image generated when I referance it by name.
I am uncertain of what you mean here; do you by 'delete image' mean 'delete image from harddisk'? So the thumbnails are temporary image files on the harddisk?
I guess some code would help.
If you are no longer referencing the object (System::Drawing::Image), then the garbage collector will eventually collect it up and free the memory for you.
However, Image is an example that uses unmanaged memory (it wraps GDI+), so calling Dispose() when you no longer need it will speed this process up by dumping the unmanaged memory immediatly.
So pretty much emptying the list will effectivly delete the objects from memory.
However, Image is an example that uses unmanaged memory (it wraps GDI+), so calling Dispose() when you no longer need it will speed this process up by dumping the unmanaged memory immediatly.
So pretty much emptying the list will effectivly delete the objects from memory.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement