挑戰:
>您如何有效地將System.BitMap映像合併到WPF應用程式中,該應用程式使用System.Windows.Media.imaging.bitMapimage? 解:
><code class="language-csharp">using System.IO;
using System.Windows.Media.Imaging;
using (MemoryStream memoryStream = new MemoryStream()) {
bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Png);
memoryStream.Position = 0;
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.StreamSource = memoryStream;
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
bitmapImage.EndInit();
}</code>
以上是如何在wpf中顯示system.drawing.bitmap?的詳細內容。更多資訊請關注PHP中文網其他相關文章!