How detect that BitmapEncoder save method is finished

209 Views Asked by At

There is i have :

public void SaveBitmapSourceToFile(string filePath, BitmapSource img)
    {
        BitmapEncoder encoder = new JpegBitmapEncoder();
        encoder.Frames.Add(BitmapFrame.Create(img));
        using (FileStream fileStream = new FileStream(filePath, FileMode.Create))
        {
            encoder.Save(fileStream);
        }
    }

I need to detect encoder.Save() finished so i can call another method that required my Jpg file

0

There are 0 best solutions below