Bitmap sourceImage = new Bitmap(sourceFile)当sourceFile是一个.bmp文件时,有时就出错 是什么原因呀提示这样的错误信息:An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dllAdditional information: Invalid parameter used.

解决方案 »

  1.   

    你将它写成这样试看还出错不:
    string imagePath=Server.MapPath("a.bmp");
    System.Drawing.Bitmap img=new Bitmap(imagepath);
      

  2.   

    你说是有时出错 有时不出错 那得看是否写对那个bmp文件名没有
    或许未能获取图片路径呢?
      

  3.   

    那检查写有sourceImage.Dispose()吗?
    你的报错信息中第二项:使用了无效的参数信息 
    可能就是你的路径名称的写法有问题