Niklas
Niklas

Reputation: 1853

How can i close image file that is created from "ironbarcode" barcode generator

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"));

Upvotes: 0

Views: 40

Answers (0)

Related Questions