2011-03-23 133 views

回答

2

您可以将其转换为BitmapSource然后访问这些属性。

if (theImage.ImageSource is BitmapSource) 
{ 
    BitmapSource bitmap = (BitmapSource)theImage.ImageSource; 
    int width = bitmap.Width; 
} 

Here is more info on the BitmapSource class.

+0

将是获得图像的大小,因为它是在它的压缩形式? – tweetypi 2011-03-23 03:27:41

+0

试一试,看看属性。按“大小”你是指字节或维度? – 2011-03-23 12:56:01