MyImage.ImageOpened += new EventHandler(Image_ImageOpened);
}
void Image_ImageOpened(object sender, RoutedEventArgs e)
{
Image img = (Image)sender;
BitmapImage bi = (BitmapImage)img.Source;
double width = bi.PixelWidth;
double height = bi.PixelHeight;
}
Showing posts with label Silverlight. Show all posts
Showing posts with label Silverlight. Show all posts
Sunday, April 4, 2010
TIPS: Get actual width and height of an Image
You can use ImageOpened event to get actual width and height of an Image like below:
Labels:
Silverlight
Subscribe to:
Posts (Atom)