if (imageFiles.Count() > 0) { foreach (string str in imageFiles) { CreateATyhumbnail(str); } }
private void CreateATyhumbnail(string imagePath) { // Create an Image control Image thumbnailImage = new Image(); thumbnailImage.Width = 130; // Create a BitmapImage and sets its DecodePixelWidth and DecodePixelHeight BitmapImage bmpImage = new BitmapImage(); bmpImage.BeginInit(); bmpImage.UriSource = new Uri(imagePath); bmpImage.DecodePixelWidth = 120; bmpImage.DecodePixelHeight = 120; bmpImage.EndInit(); // Set Source property of Image thumbnailImage.Source = bmpImage; imageGrid.Children.Add(thumbnailImage); thumbnailImage.Margin = new Thickness(15); //Canvas.SetLeft(thumbnailImage,130);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)