Hi all,
I want to know, is it possible to resize an Image control according to the size of selected image, filled with, at run time?
Thanks! a lot for any reply...
Size of an Image Control
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Benjamin KemnerRank #7,492 · 240 reputationPosted Jul 26, 2011, 10:54 PM EDT
// load pic
Uri src = new Uri(@"/WpfPictureExport;component/Images/Chrysanthemum.jpg", UriKind.Relative);
BitmapImage img = new BitmapImage(src);
image2.Source = img;
// set the size of the control to picture
image2.Height = img.PixelHeight;
image2.Width = img.PixelWidth;
Usman Zafar9 reputationPosted Dec 8, 2011, 3:45 PM EST