FileSelectFolder, myFolder, imageExt := "jpg,bmp,gif,png" main := new imageDisplay(1, A_ScreenWidth / 1.2 - 20, A_ScreenWidth / 3, ( A_ScreenWidth / 1.2 ) / 4.6 ) imageList := Object() Gui, Color, 0x333333 Gui, Show MsgBox, % myFolder Loop, %myFolder%\*.*,, 1 { If A_LoopFileExt not in %imageExt% continue main.newImage( A_LoopFileFullPath, A_Index, "Name" ) imageList[ A_Index ] := A_LoopFileFullPath } Return Class imageDisplay { __New( guiNumber, width, height, imageWidth=200, imageHeight="auto", eventName="evnt_" ) { static imgList this.width := width this.height := height this.imageWidth := imageWidth this.imageHeight := imageHeight Gui, %guiNumber%: Add, ActiveX, w%width% h%height% vimgList, MSHTML: html = (
) imglist.write( html ) ComObjConnect(imgList, eventName ) imglist.getElementsByTagName("body")[0].style.backgroundColor := "333333" imglist.getElementsByTagName("div")[0].style.overflow := "auto" imgList.getElementsByTagName("div")[0].style.height := height - 20 imgList.getElementsByTagName("div")[0].style.width := width - 20 imgList.close() this.var := imgList return this } newImage( imageDir, imageID, imageText ) { element := this.var.createElement( "img" ) element.src := imageDir element.Id := imageID element.style.width := this.imageWidth element.style.height := this.imageHeight element.style.padding := this.imageSpace ? this.imageSpace : "10px" this.var.getElementById( "imgCont" ).appendChild( element ) } } evnt_OndblClick( p* ) { global activeImage elm := p[1].parentWindow.event.srcElement.Id activeImage := p[1].getElementById(elm).Id SetTimer, OnClick, -1 } evnt_OnClick( p* ) { global prevImage, backgroundColor prevImage.style.backgroundColor := backgroundColor elm := p[1].parentWindow.event.srcElement.Id If elm is not digit Return image := p[1].getElementById(elm) image.style.backgroundColor := "FFFFFF" prevImage := image } OnClick: imageDir := imageList[ activeImage ] MsgBox, % imageDir Return GuiClose: ExitApp Return