Jump to content

Recommended Posts

Posted (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:

#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 by Melba23
Added code tags
  • Moderators
Posted

Thingy2nl,

As the UDFs in question are both mine, I will take a look into the problem this afternoon.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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

 

Posted

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
Posted

Thingy2nl,

Glad you got it sorted - and thanks.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...