Hi Paul, I have a couple of places that have an BMP loaded in the Image control on a form. The user can change the picture in a popup modal form. The original image is overwritten on disk with code in the modal. When the modal closes, the image is refreshed on the original form.
I'm curious if the GDIPlusX method is leaving the control open with a file handle to the image. HTH, Tracy -----Original Message----- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of paul.newton.h...@gmail.com Sent: Sunday, April 03, 2022 2:55 PM To: profoxt...@leafe.com Subject: Problem replacing/deleting temporary picture file Hi all I have an image control whose Picture property is a temporary BMP (say Temp1.BMP). I am trying to redisplay the image control with a new Picture property of Temp2.BMP or with a modified Temp1.BMP Using GDIPlusX, I am creating the BMPs with the BitMap.Save method. Once I have used Temp1.BMP as the picture and later trying to use BitMap.Save again to overwrite Temp1.BMP, the changes are not saved (no error though) So I used BitMap.Save to create Temp2.BMP, set Temp2.BMP as the picture (which worked fine) and then tried to delete Temp1.BMP. Again this failed (file in use or similar). I tried Clear Resource Temp1.BMP before Erase Temp1.BMP but that didn't work either. Any suggestions would be welcome. Many thanks Paul Newton --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: https://leafe.com/archives This message: https://leafe.com/archives/byMID/003f01d848f3$467b5410$d371fc30$@powerchurch.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.