Bitmap(ImageFile)
private Bitmap BitmapImage2Bitmap(BitmapImage bitmapImage) { // BitmapImage bitmapImage = new BitmapImage(new Uri("../Images/test.png", UriKind.Relative)); using(MemoryStream outStream = new MemoryStream()) { BitmapEncoder enc = new BmpBitmapEncoder(); enc.Frames.Add(BitmapFrame.Create(bitmapImage)); enc.Save(outStream); System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(outStream); // return bitmap; <-- leads to problems, stream is closed/closing ... return new Bitmap(bitmap); } }
Bitmap bm = new Bitmap(path+filename+".jpg");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)