Unable to delete image file

1 Answer 24 Views
BarcodeView
Martin Hamilton
Top achievements
Rank 1
Iron
Iron
Veteran
Martin Hamilton asked on 21 Feb 2025, 04:54 PM

After performing an ExportToImage using the RadBarCodeView, I'd like to delete the image from the harddrive.

But it always says that the file is in use and cannot be deleted.

I tried setting the RadBarCodeView1.value = Nothing (trying to make it release the image file) but that doesn't work either.

Any idea's on how to release that image file?

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 24 Feb 2025, 12:18 PM

Hello Martin,

Thank you for your interest in our RadBarcodeView for WinForms.

I have tested your scenario, but could not observe any locking on the exported image. May I ask you to share the code snippet responsible for exporting the RadBarcodeView in your application?

What I have tried is to export the control into an image on the hard drive and then call the File.Delete() method. No error appears on my side:

this.radBarcodeView1.ExportToImage("../../img.png", new Size(200,200));
File.Delete("../../img.png");

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
BarcodeView
Asked by
Martin Hamilton
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or