0

I use nuGetPacket ironBarCode to create a code128 barcode, it works fine, i load the image to a flowdocument in a wpf usercontrol. I want to delete the image file after i have loaded it into the application but the file is locked - how can i close the file handle- code:

            Guid g = Guid.NewGuid();
        
             BarcodeWriter.CreateBarcode(ApplicationHandler.TransactionHandler
             .CurrentTransaction.TransactionNumber.ToString()
                            , BarcodeWriterEncoding.Code128).ResizeTo(100, 50)
                                    .SaveAsImage(PrintHandler.GetBinCatalogFilePath() + g + 
              "Code128.jpeg");


        Code128.Source = new BitmapImage(new Uri(PrintHandler.GetBinCatalogFilePath() + g + 
       "Code128.jpeg"));
Niklas
  • 1,753
  • 4
  • 16
  • 35

0 Answers0