Graphics重绘后能够容易取的PictureBox里图片的width和height,但是不在清楚怎么可以取到图片的大小,如多少KB,文件类型
谢谢各位了

解决方案 »

  1.   

    Image img=PictureBox1.Image.Clone() as Image;int width=img.Size.Width;//宽度img.PixelFormat//格式至于多少kb。这个和最后保存的文件格式和压缩质量有关,无法获取。
      

  2.   

    PropertyInfo pi= pictureBox1.GetType().GetProperty("ImageRectangle", BindingFlags.Instance | BindingFlags.NonPublic); 
    Rectangle  rec=(Rectangle)pi.GetValue(pictureBox1, null); 
      

  3.   


    还有一个问题,我在Clone图片保存之后,用FileStream去读的话,竟然要比原图大好多这是为什么呢?