I have an Image object in my C# code and I'd like to use it as ImageSource for ImageBrush. Is there a way to do this?
In other words, I need something like this:
Image image = new Image();
image.source = GetBitmapImage();
//execute various image transforms here...
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = image; // this doesn't work
Thanks.
You already have
ImageSource
- it is yourGetBitmapImage()
, so you can useor use your image.source: