找回密码
 加入
搜索
查看: 1632|回复: 3

[图形处理] _GDIPlus_ImageGetDimension($hImage)开机启运出错

[复制链接]
发表于 2016-5-11 17:54:00 | 显示全部楼层 |阅读模式
如题
$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[0] <> @DesktopWidth Or $Dimension[1] <> @DesktopHeight Then
        _PicChangeSize($Wallpaper, @ScriptDir & '\' & @DesktopWidth & 'x' & @DesktopHeight & '.jpg', @DesktopWidth, @DesktopHeight)
        _WinAPI_DeleteObject($hImage)
        $hImage = _GDIPlus_BitmapCreateFromFile(@ScriptDir & '\' & @DesktopWidth & 'x' & @DesktopHeight & '.jpg')
EndIf
正常运行时无问题,当设为开机启动时会报错。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2016-5-12 09:25:36 | 显示全部楼层
do
$Dimension = _GDIPlus_ImageGetDimension($hImage)
until not @error
发表于 2016-5-12 13:23:28 | 显示全部楼层
看看 $Wallpaper 的返回值
发表于 2016-5-13 23:54:57 | 显示全部楼层
很是以前我也出现过错误,后来只增加了配置文件路径!问题就没有出现了!后来写代的时候我都写上路径宏数!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 08:55 , Processed in 0.079612 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表