I'm having trouble adding an image that I just created, but at some place like "C: ..." Is not stored "
So I was wondering if there was no way to add that image to WPF, without it it should be saved ....
What I want Here's an example.
bitmap bit; LoadBitmap (bit); Image = bit; I have found a solution in the blog of Tamir Khasan:
Use Public static bitmapsource convertbitmap (system drawings. Bitmap source) {Return to system. Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap (source.GetHbitmap), IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions ()); } You can
bitmap bit; LoadBitmap (bit); Image. Source = convertbitmap (bit);
Comments
Post a Comment