I am using two Picture controls - one that is hidden that I am using to get the size of the image, and the other one to at a size the fits the screen easily.
I'm struggling trying to resize the visible control to autosize. It doesn't work if I use the .Opt method, presumably because that's reserved for the Common properties. And if I use Move and set either the height or width to -1, it uses 0 and the image is not visible.
Code: Select all
imgGui:=Gui("-SysMenu +Resize -MaximizeBox","Which way should this image be positioned?")
imgGui.MarginX:=10
imgGui.MarginY:=10
guiPicTemp:=imgGui.AddPic("Hidden")
guiPicShow:=imgGui.AddPic("xp yp h619 w-1")
imgGui.Show("Hide w600 h600")
Loop Files, fldrSrc . "\*.*" {
guiPicTemp.Value:=A_LoopFileFullPath
guiPicShow.Value:=A_LoopFileFullPath
guiPicTemp.GetPos(&zxT, &zyT, &zwT, &zhT)
imgGui.GetPos(&zxW, &zyW, &zwW, &zhW)
If (zwT>zHT) {
zwS:=zwW-20
guiPicShow.Move(zxT,zyT,zwS,-1)
} else {
zhS:=zhW-20
guiPicShow.Move(zxT,zyT,-1,zhS)
}
guiPicShow.GetPos(&zxC, &zyC, &zwC, &zhC)
imgGui.Show()
Pause
}
Is there any way to change the size of a picture control and have it autosize the remaining dimension, or am I going to need to calculate it each time?