Show / Hide Table of Contents

Method wpfBuilder.Image(+ 1 overload)


Overload

Loads image into the last added System.Windows.Controls.Image.

public wpfBuilder Image(ImageSource source, Stretch stretch = Stretch.None, StretchDirection stretchDirection = StretchDirection.DownOnly)
Parameters
source  (ImageSource)

Sets System.Windows.Controls.Image.Source.

stretch  (Stretch)

Sets System.Windows.Controls.Image.Stretch.

stretchDirection  (StretchDirection)

Sets System.Windows.Controls.Image.StretchDirection.

Returns
wpfBuilder
Exceptions
NotSupportedException

The last added element is not Image.

Remarks

To load vector images from XAML, don't use Image control and this function. Instead create control from XAML, for example with ImageUtil.LoadWpfImageElement, and add it with wpfBuilder.Add.

See Also

icon.ToWpfImage
ImageUtil

Overload(top)

Loads image from a file or URL into the last added System.Windows.Controls.Image.

public wpfBuilder Image(string source, Stretch stretch = Stretch.None, StretchDirection stretchDirection = StretchDirection.DownOnly)
Parameters
source  (string)

File path etc. See ImageUtil.LoadWpfImage. Sets System.Windows.Controls.Image.Source.

stretch  (Stretch)

Sets System.Windows.Controls.Image.Stretch.

stretchDirection  (StretchDirection)

Sets System.Windows.Controls.Image.StretchDirection.

Returns
wpfBuilder
Exceptions
NotSupportedException

The last added element is not Image.

Remarks

If fails to load, prints warning. See print.warning.