_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正常运行时无问题,当设为开机启动时会报错。
do
$Dimension = _GDIPlus_ImageGetDimension($hImage)
until not @error 看看 $Wallpaper 的返回值 很是以前我也出现过错误,后来只增加了配置文件路径!问题就没有出现了!后来写代的时候我都写上路径宏数!!
页:
[1]