直接用400x300了
不知行否- Add-Type -AssemblyName System.Drawing
-
- $img_bg=[Drawing.Image]::FromFile('桌面背景.jpg')
- if(($img_bg.width -lt 400*2) -or ($img_bg.height -lt 300)){"do noting";cmd /c pause}
- $img_wechat=[Drawing.Image]::FromFile('微信收款码.jpg')
- $img_alipay=[Drawing.Image]::FromFile('支付宝收款码.jpg')
-
- $new_image=[drawing.bitmap]::new($img_bg.width,$img_bg.height)
- $img_canvas=[drawing.graphics]::fromimage($new_image)
- $img_canvas.InterpolationMode=[Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
- $img_canvas.drawimage($img_wechat,$new_image.width-400,$new_image.height-300,400,300,)
- $img_canvas.drawimage($img_alipay,$new_image.width-400*2,$new_image.height-300,400,300,)
- $new_image.save( 'new'+[datetime]::now.GetHashCode().tostring()+'.jpg',[Drawing.Imaging.ImageFormat]::Jpeg)
-
- $img_canvas.dispose();$new_image.dispose();
- $img_alipay.dispose();$img_wechat.dispose();$img_bg.dispose();
复制代码
|