[.net] Quick .NET question

Started by
3 comments, last by philprice 17 years, 8 months ago
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. :)
Advertisement
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.
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
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.
When I do that it only erases one of the images from the displayed images though when I call Dispose(). Maybe I am doing something wrong. I'll post my code tonight.
A code example would be very useful in this case ;)

This topic is closed to new replies.

Advertisement