byarotsky Posted November 25, 2012 Posted November 25, 2012 (edited) I am attempting to build a script that will pull jpg files from my external device, copy local, resize and change orientation and move to the server is serveral places. Part of the script I would like to have a preview screen to check off the files that I want to process. I have taken some examples and tried to manipulate to do what I want, but I am struggling to get my list of images to show properly. Basically in this test I would like to read list of files from folder Generate a screen with thumbnails and a corresponding checkbox Each thumbnail will show a different file in the folder Currently I am only able to show either the last image in the first location and the rest are blank or all images are the same picture. Also I haven't even tried getting more than one line of images (fill the screen). Any help would be greatly appreciated. Thanks Brad expandcollapse popup#include <GDIPlus.au3> #include <Array.au3> #include <File.au3> Global $ImgPath = "C:Documents and SettingsOwnerDesktopTest2" Local $hGui, $iPic, $hGraphic, $hBitmap, $hImage $hGui = GUICreate("", @DesktopWidth, @DesktopHeight) $iPic = GUICtrlCreatePic("", 0, 25, @DesktopWidth, 25) $ImgHeight = 133 $ImgWidth = 133 $ImgSpacing = 10 Local $localfile = _FileListToArray($ImgPath, "*.jpg", 1) ; List all jpg files in last folder _ArrayDelete($localfile, 0) _ArraySort($localfile) ;_ArrayDisplay($localfile) _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui) $hBitmap = _GDIPlus_BitmapCreateFromGraphics(@DesktopWidth, $ImgHeight, $hGraphic) _GDIPlus_GraphicsDispose($hGraphic) $hGraphic = _GDIPlus_ImageGetGraphicsContext ($hBitmap) While UBound($localfile) $PopFileName = _ArrayPop($localfile) For $i = 0 To @DesktopWidth - $ImgWidth Step $ImgWidth + $ImgSpacing $hImage = _GDIPlus_ImageLoadFromFile ($ImgPath & $PopFileName) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, $i + $ImgSpacing , 0, $ImgWidth, $ImgHeight) GUICtrlCreateCheckbox($PopFileName, $i + $ImgSpacing , $ImgHeight + 25, 120, 20) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) Next WEnd $hImage = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172, 0, $hImage)) _GDIPlus_ShutDown() GUISetState(@SW_SHOW, $hGui) While GUIGetMsg() <> -3 WEnd Edited December 2, 2012 by byarotsky
byarotsky Posted December 2, 2012 Author Posted December 2, 2012 Sorry, I have corrected the posted code. Can anyone shed any light on this? Thanks Brad
UEZ Posted December 3, 2012 Posted December 3, 2012 This might help you -> Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
byarotsky Posted December 3, 2012 Author Posted December 3, 2012 Thank you. This is looking very close to what I am looking for. I will pick it apart later this week. Brad
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now