0

I have the following in a WPF application:

  1. Create a stackpanel
  2. Create a bitmapsource from the stackpanel
  3. Create a FixedDocument

So, I'm trying to get from step 2 to step 3. FixedDocuments only accept UIElement objects for Children.Add. Is there a way to get from a bitmapsource to a UIElement (or some other object) that will be accepted by a FixedDocuemnt? Yes, I realize that a Stackpanel is a UIElement and I could add that to my document but I prefer to add it as an image.

H.B.
  • 166,899
  • 29
  • 327
  • 400
Unknown Coder
  • 6,625
  • 20
  • 79
  • 129

1 Answers1

1

I believe you are looking for System.Windows.Controls.Image. Given BitmapSource bs

Image anImage = new Image();
anImage.Source = bs;

should do the trick to get from 2. to 3.

Mike
  • 920
  • 1
  • 9
  • 11