spNewItem.Children.Add(BuildImageButton(@"Images\fan1.ico", h, w)); ... public System.Windows.Controls.Image BuildImageButton(string source, int h, int w) { System.Windows.Media.Imaging.BitmapImage bi = new System.Windows.Media.Imaging.BitmapImage(); bi.UriSource = new Uri(source, UriKind.Relative); Image img = new Image { Width = w, Height = h, Source = bi}; img.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; img.Margin = new Thickness(5, 0, 0, 0); return img; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)