Hi @LPow
In .NET 8 Using keyword syntax is changed. Kindly check the below code snippet for additional reference.
Reference Code Snippet
private BitmapImage BitmapToImageSource(Bitmap BMapm)
{
using var mem= new MemoryStream();
BMapm.Save(mem, System.Drawing.Imaging.ImageFormat.Jpeg);
mem.Position = 0;
BitmapImage bmi = new BitmapImage();
bmi.BeginInit();
bmi.StreamSource = mem;
bmi.CacheOption = BitmapCacheOption.OnLoad;
bmi.EndInit();
return bmi;
}
you can check below link for additional reference.
URL: https://dotnettutorials.net/lesson/using-declarations-csharp-8/
Hope this will helps 🙂