Hi Tracy

Thanks for your reply.  I used Sysinternals Process Monitor to see if there
was a file handle for the temp image file and there wasn't one.  However, I
suspect it is something along those lines.  In the meantime I am using a
different temp file each time and then deleting them in the form Destroy
event.

Paul

-----Original Message-----
From: ProfoxTech <profoxtech-boun...@leafe.com> On Behalf Of Tracy Pearson
Sent: 05 April 2022 14:44
To: profoxt...@leafe.com
Subject: RE: Problem replacing/deleting temporary picture file

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/00f001d849a0$3689dfb0$a39d9f10$@gmail.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.

Reply via email to