diff --git a/LIB/Export.ahk b/LIB/Export.ahk index 2d2b68ef..14ac6649 100644 --- a/LIB/Export.ahk +++ b/LIB/Export.ahk @@ -1092,8 +1092,12 @@ CenterImgSrchCoords(File, ByRef CoordX, ByRef CoordY) { static LoadedPic LastEL := ErrorLevel - - Gui, Pict:Add, Pic, vLoadedPic, % RegExReplace(File, "^(\*\w+\s)+") + + RegExMatch(File, "i)^(?:\*\w+\s)*\*(?w-?[0-9]+)\s", Scale) + RegExMatch(File, "i)^(?:\*\w+\s)*\*(?h-?[0-9]+)\s", Scale) + ScalePars := Trim(ScaleW_pv " " ScaleH_pv) ; (when no scale parameters are used this will be equal to "") + + Gui, Pict:Add, Pic, vLoadedPic %ScalePars%, % RegExReplace(File, "^(\*\w+\s)+") GuiControlGet, LoadedPic, Pict:Pos Gui, Pict:Destroy CoordX += LoadedPicW // 2 diff --git a/LIB/Internal.ahk b/LIB/Internal.ahk index d3063840..1c9ae447 100644 --- a/LIB/Internal.ahk +++ b/LIB/Internal.ahk @@ -374,8 +374,12 @@ CenterImgSrchCoords(File, ByRef CoordX, ByRef CoordY) { static LoadedPic LastEL := ErrorLevel - - Gui, Pict:Add, Pic, vLoadedPic, % RegExReplace(File, "^(\*\w+\s)+") + + RegExMatch(File, "i)^(?:\*\w+\s)*\*(?w-?[0-9]+)\s", Scale) + RegExMatch(File, "i)^(?:\*\w+\s)*\*(?h-?[0-9]+)\s", Scale) + ScalePars := Trim(ScaleW_pv " " ScaleH_pv) ; (when no scale parameters are used this will be equal to "") + + Gui, Pict:Add, Pic, vLoadedPic %ScalePars%, % RegExReplace(File, "^(\*\w+\s)+") GuiControlGet, LoadedPic, Pict:Pos Gui, Pict:Destroy CoordX += LoadedPicW // 2