Bitmap bitmap = Resources.Logo;//loading from resource BitmapSource imgSource = ConvertToBitmapSource(bitmap);//converting to WPF format drawingContext.DrawImage(imgSource,new Rect(Sizes.Gutter + 10,Sizes.Margin + 10,300,30)); public static BitmapSource ConvertToBitmapSource(Bitmap bitmap) { IntPtr hBitmap = bitmap.GetHbitmap(); return Imaging.CreateBitmapSourceFromHBitmap(hBitmap,IntPtr.Zero,Int32Rect.Empty,BitmapSizeOptions.FromEmptyOptions()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)