سؤال

كيفية تعيين مصدر System.Windows.Controls.Image إذا كان المصدر هو نوع System.Windows.Interop.InteropBitmap؟معلومات InteropBitmap أدناه:

{System.Windows.Interop.InteropBitmap}
[System.Windows.Interop.InteropBitmap]: {System.Windows.Interop.InteropBitmap}
base {System.Windows.Media.ImageSource}: {System.Windows.Interop.InteropBitmap}
DpiX: 96.0
DpiY: 96.0
Format: {Bgra32}
Height: 851.0
IsDownloading: false
Metadata: null
Palette: null
PixelHeight: 851
PixelWidth: 900
Width: 900.0

شكرًا لك

هل كانت مفيدة؟

المحلول

يبدو الأمر كذلك InteropBitmap يرث من ImageSource بالفعل.يجب أن تكون قادرا على القيام به myImage.Source = myInteropbitmap; ?

المرجع:

http://msdn.microsoft.com/en-us/library/system.windows.interop.interopbitmap.aspx

InteropBitmap إلى BitmapImage

http://msdn.microsoft.com/en-us/library/system.windows.controls.image.source.aspx

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top