Thingy2nl Posted June 10, 2016 Posted June 10, 2016 (edited) Hi all, I am having some issues with a small proof of concept script. What this script will need to do in the end is monitor a directory for incoming jpg files. Pick them up and show them to the user while providing the using some options in the right frame ($iFrame_A, 1) for processing the selected jpg, then clear the screen and start monitoring again. The two issues i have now are: 1. I can only get GDI to display new images by performing a _GUIFrame_Switch. Turning off the main gui and turning it on again works, but that will blink the screen. So that is not an option. Is there something stupid i'm overlooking? 2. Whenever the number of pictures get to much for the screen size, I would like a scroll bar in the left frame ($iFrame_A, 0), but whatever i try, i can not get a scroll bar to show... again, probably something I am missing.... Anyone who can shed some light on this (esp Melba )? Short source: expandcollapse popup#Region Include #include <GDIPlus.au3> #include <File.au3> #include <GUIFrame.au3> #include <GUIScrollBars_Ex.au3> #EndRegion ; Use @DesktopWidth and @DesktopHeight for screen resolution Local $hMainForm2 = GUICreate("BIS Processing ", @DesktopWidth-200 , @DesktopHeight-200, 100, 100, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) Local $iFrame_A = _GUIFrame_Create($hMainForm2, 0, @DesktopWidth-200-300) _GUIFrame_ResizeSet(0) ; Start monitoring for pictures ; Just use an fixed dir for now Local $JPGPath = "C:\Users\admin\Desktop\JPG" Local $JPGFiles = _FileListToArray( $JPGPath & "\", "*.jpg" ) _GDIPlus_Startup() GUISetState(@SW_SHOW, $hMainForm2) ; ; Need to use frame switching to force GDI to show pictures ; _GUIFrame_Switch($iFrame_A, 1) _GUIFrame_Switch($iFrame_A, 0) Local $hPic1 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[1], 10, 10, 400, 255) _GUIFrame_Switch($iFrame_A, 1) _GUIFrame_Switch($iFrame_A, 0) Local $hPic2 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[2], 10, 275, 400, 255) _GUIFrame_Switch($iFrame_A, 1) _GUIFrame_Switch($iFrame_A, 0) Local $hPic3 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[3], 10, 540, 400, 255) _GUIFrame_Switch($iFrame_A, 1) _GUIFrame_Switch($iFrame_A, 0) Local $hPic4 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[4], 10, 805, 400, 255) _GUIFrame_Switch($iFrame_A, 1) _GUIFrame_Switch($iFrame_A, 0) ; ; No scrollbar is showing, can this be done while using frames? ; local $setbar = _GUIScrollBars_Generate(_GUIFrame_GetHandle($iFrame_A, 0), 0, 1000) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Edited June 10, 2016 by Melba23 Added code tags
Moderators Melba23 Posted June 10, 2016 Moderators Posted June 10, 2016 Thingy2nl, As the UDFs in question are both mine, I will take a look into the problem this afternoon. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Thingy2nl Posted June 10, 2016 Author Posted June 10, 2016 Managed to solve the issue. For some reason, I worked with the notion that frames were assigned 0 and 1... after changing to 1 for left and 2 for the right side.... it al started making a lot more sense. The fact that the handle for frame 0 was always invalid should have triggered me sooner.... Anyway, problem solved. Thanx for the response Melba and even more Thank You for you great UDF's and support in general! Thing
Moderators Melba23 Posted June 10, 2016 Moderators Posted June 10, 2016 Thingy2nl, Glad you got it sorted - and thanks. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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