|
|
发表于 2022-8-23 10:07:08
|
显示全部楼层
回复 10# 0475 - @echo off
- set "PictureName1=img\209.png"
- set "PictureName2=img\201.jpg"
- set "PictureName3=img\202.jpg"
- cd /d "%~dp0"
- for /f "tokens=1-2" %%a in ('mshta VBScript:Execute("CreateObject(""Scripting.Filesystemobject"").GetStandardStream(1).Write(screen.width&"" ""&screen.height)"^)(close^)') do (
- set "ScreenWidth=%%a"
- set "ScreenHeight=%%b"
- )
- for %%i in (%PictureName1% %PictureName2% %PictureName3% ) do (
- call :GetPicSize "%%i"
- )
- goto :eof
- :GetPicSize
- for /f "tokens=1,3" %%a in ('nconvert -info "%~1"') do (
- set "str=%%a"
- if "%%a" equ "Width" (
- set "PictureWidth=%%b"
- ) else if "%%a" equ "Height" (
- set "PictureHeight=%%b"
- )
- )
- set /a PositionX=(ScreenWidth-PictureWidth)/2
- set /a PositionY=(ScreenHeight-PictureHeight)/2
- BeePhoto /p:"%~1" /x:%PositionX% /y:%PositionY%
复制代码 |
|