- 帖子
- 102
- 积分
- 42
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2015-3-25
|
回复 10# went
大神 升级了之后 现在运行提示的是以下内容了。而且 必须要在与图片同级目录下运行。
方法调用失败,因为 [System.IO.FileInfo] 不包含名为“new”的方法。
所在位置 行:6 字符: 71
+ if(Test-Path -LiteralPath $src){$srcFile=[System.IO.FileInfo]::new <<<< (
$src)}else{Write-Host "路径错误";return}
+ CategoryInfo : InvalidOperation: (new:String) [], RuntimeExcept
ion
+ FullyQualifiedErrorId : MethodNotFound
方法调用失败,因为 [System.Drawing.Rectangle] 不包含名为“new”的方法。
所在位置 行:13 字符: 45
+ $srcRect=[System.Drawing.Rectangle]::new <<<< ($srcBmp.Width*($left/100),
$srcBmp.Height*($top/100),$tagWidth,$tagHeight) #源裁剪矩形
+ CategoryInfo : InvalidOperation: (new:String) [], RuntimeExcept
ion
+ FullyQualifiedErrorId : MethodNotFound
方法调用失败,因为 [System.Drawing.Rectangle] 不包含名为“new”的方法。
所在位置 行:14 字符: 45
+ $tagRect=[System.Drawing.Rectangle]::new <<<< (0,0,$tagWidth,$tagHeight)
#目标矩形
+ CategoryInfo : InvalidOperation: (new:String) [], RuntimeExcept
ion
+ FullyQualifiedErrorId : MethodNotFound
方法调用失败,因为 [System.Drawing.Bitmap] 不包含名为“new”的方法。
所在位置 行:15 字符: 41
+ $tagBmp=[System.Drawing.Bitmap]::new <<<< ($tagWidth,$tagHeight) #目标图
片
+ CategoryInfo : InvalidOperation: (new:String) [], RuntimeExcept
ion
+ FullyQualifiedErrorId : MethodNotFound
使用“1”个参数调用“FromImage”时发生异常:“值不能为空。
参数名: image”
所在位置 行:16 字符: 44
+ $g=[System.Drawing.Graphics]::FromImage <<<< ($tagBmp) #画笔
+ CategoryInfo : NotSpecified: ( [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
不能对值为空的表达式调用方法。
所在位置 行:17 字符: 17
+ $g.DrawImage <<<< ($srcBmp,$tagRect,$srcRect,[System.Drawing.GraphicsUnit
]:ixel)
+ CategoryInfo : InvalidOperation: (DrawImage:String) [], Runtime
Exception
+ FullyQualifiedErrorId : InvokeMethodOnNull
不能对值为空的表达式调用方法。
所在位置 行:18 字符: 17
+ $tagBmp.Save <<<< (($srcFile.DirectoryName+"\"+$srcFile.BaseName+"_cut"+$
srcFile.Extension),[System.Drawing.Imaging.ImageFormat]::Jpeg)
+ CategoryInfo : InvalidOperation: (Save:String) [], RuntimeExcep
tion
+ FullyQualifiedErrorId : InvokeMethodOnNull
不能对值为空的表达式调用方法。
所在位置 行:20 字符: 20
+ $tagBmp.Dispose <<<< ()
+ CategoryInfo : InvalidOperation: (Dispose:String) [], RuntimeEx
ception
+ FullyQualifiedErrorId : InvokeMethodOnNull
D:\0.系统文档桌面\桌面\新建文件夹 (4)\1\0003.jpg 处理完成!
请按任意键继续. . . |
|