🙆‍♀️

WPF メモ

2024/08/14に公開

FlowDocument に画像を表示する

:
System.IO.FileInfo imgFileInfo = new System.IO.FileInfo(imgFilePath);
:
System.Windows.Controls.Image myImage = new System.Windows.Control.Image();
:
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = new Uri(imgFileInfo.FullName);
bitmap.EndInit();
myImage.Source = bitmap;
:
flowDocument.Blocks.Add( new System.Windows.Documents.BlockUIContainer( myImage ) );

Discussion