sunyu4506 发表于 2016-5-11 17:54:00

_GDIPlus_ImageGetDimension($hImage)开机启运出错

如题$Wallpaper = @ScriptDir & '\Wallpaper\' & IniRead('Config.ini', 'Wallpaper', 'Wallpaper', 0)
$Wallpaper = @ScriptDir & '\Wallpaper\' & IniRead('Config.ini', 'Wallpaper', 'Wallpaper', 0)
$hImage = _GDIPlus_BitmapCreateFromFile($Wallpaper)
$Dimension = _GDIPlus_ImageGetDimension($hImage)
If $Dimension <> @DesktopWidth Or $Dimension <> @DesktopHeight Then
        _PicChangeSize($Wallpaper, @ScriptDir & '\' & @DesktopWidth & 'x' & @DesktopHeight & '.jpg', @DesktopWidth, @DesktopHeight)
        _WinAPI_DeleteObject($hImage)
        $hImage = _GDIPlus_BitmapCreateFromFile(@ScriptDir & '\' & @DesktopWidth & 'x' & @DesktopHeight & '.jpg')
EndIf正常运行时无问题,当设为开机启动时会报错。

zghwelcome 发表于 2016-5-12 09:25:36

do
$Dimension = _GDIPlus_ImageGetDimension($hImage)
until not @error

131738 发表于 2016-5-12 13:23:28

看看 $Wallpaper 的返回值

f4李文杨 发表于 2016-5-13 23:54:57

很是以前我也出现过错误,后来只增加了配置文件路径!问题就没有出现了!后来写代的时候我都写上路径宏数!!
页: [1]
查看完整版本: _GDIPlus_ImageGetDimension($hImage)开机启运出错