#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
Global $ArrayFile[1000]
Global $IndexFile = 0
Global Const $iW = @DesktopWidth, $iH = @DesktopHeight
Local $hImage,$hGraphic
$Form1 = GUICreate("Мини-галерея", 784, 584, 187, 123, BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_HSCROLL,$WS_VSCROLL,$WS_BORDER,$WS_CLIPSIBLINGS))
Local $idFilemenu = GUICtrlCreateMenu("Меню")
Local $idFileitem_1 = GUICtrlCreateMenuItem("Показать следующее изображение", $idFilemenu)
Local $idFileitem_2 = GUICtrlCreateMenuItem("Выход", $idFilemenu)
GUISetState(@SW_MAXIMIZE,$Form1)
$Form2 = GUICreate("", @DesktopWidth ,@DesktopHeight, 0, 0, $WS_CHILD, $WS_EX_CLIENTEDGE, $Form1)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
while 1
$msg = GUIGetMsg()
if ($msg = $GUI_EVENT_CLOSE) then ExitLoop
if ($msg = $idFileitem_1 ) then
Local $hSearch = FileFindFirstFile("*.jpg*")
Local $LocalIndex = 0
While 1
$sFileName = FileFindNextFile($hSearch)
If @error Then ExitLoop
$ArrayFile[$LocalIndex] = $sFileName
$LocalIndex = $LocalIndex + 1
WEnd
$hImage = _GDIPlus_ImageLoadFromFile($ArrayFile[$IndexFile])
$hImage_Scaled = _GDIPlus_ImageResize($hImage, $iW / 2, $iH / 2)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form2)
_GDIPlus_GraphicsDrawImage($hGraphic,$hImage_Scaled,($iW -_GDIPlus_ImageGetWidth($hImage_Scaled))/2,($iH - _GDIPlus_ImageGetHeight($hImage_Scaled))/2)
$IndexFile = $IndexFile + 1
Endif
if ($msg = $idFileitem_2 ) then ExitLoop
wend
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
|