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) |
stretch (Stretch) |
stretchDirection (StretchDirection) |
Returns
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
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) |
stretchDirection (StretchDirection) |
Returns
Exceptions
NotSupportedException
The last added element is not Image. |
Remarks
If fails to load, prints warning. See print.warning.