Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add Image of any size using "XAML icon name" to a WPF window
#1
I can add image to WPF with Icon's name using:
 
Code:
Copy      Help
FrameworkElement LoadWpfImageElement(string image)

But is there an easy way to set its size inside WPF windows by just using Icon's name without converting FrameworkElement -> Bitmap -> Base64 -> BitmapFrame then assign it to Image.Source
#2
Code:
Copy      Help
var b = new wpfBuilder("My WPF app").Columns(0);

b.R.Add(ImageUtil.LoadWpfImageElement("*BootstrapIcons.HouseDoor #9156A9")); //normal
b.R.Add(ImageUtil.LoadWpfImageElement("*BootstrapIcons.HouseDoor #9156A9 @12")); //smaller; this also can be used in toolbars etc
b.R.Add(ImageUtil.LoadWpfImageElement("*BootstrapIcons.HouseDoor #9156A9")).Size(32, 32); //bigger or smaller

b.ShowDialog();
#3
Thanks for the help! I see now how simple it is. Really appreciate it!


Forum Jump:


Users browsing this thread: 1 Guest(s)