Jump to content

GUI not updating image (GDI used)


Damein
 Share

Recommended Posts

Kind of hard to explain. What happens is at first run it downloads 4 images, and a bunch of data. Then the user either selects how many minutes until it "refreshes" (Redownloads images/data) or manually does it.

Now, the data is all refreshed and redownloaded, but the images do not change for some reason. It doesn't even download the new images.

Here is the widget (GUI)

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Icon.ico
#AutoIt3Wrapper_Res_Comment=Beta testing
#AutoIt3Wrapper_Res_Description=Pulls data from Weather.com
#AutoIt3Wrapper_Res_Fileversion=1.2
#AutoIt3Wrapper_Res_LegalCopyright=RobertSSoftware
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include "WeatherUDF.au3"
#include <array.au3>
Opt("GUIOnEventMode", 1)
Global $Statuses = IniReadSection("Statuses.ini", "Status")
Global $XY = IniReadSection("Statuses.ini", "XY")
Global $ZipCode, $GUI, $hgraphic, $himage, $RightNowGui, $TodayGui, $TonightGui, $TomorrowGui, $RefreshTime
$ZipCode = InputBox("Zip code", "Please input your zip code")
$ZipCode2 = "http://www.zip-codes.com/zip-code/" & $ZipCode
Global $sSource = BinaryToString(InetRead($ZipCode2))
$City = StringRegExp($sSource,'(?i)(?s)<a href="/city/(.*?)-(.*?).asp',1)
$State = StringRegExp($sSource,'(?i)(?s)<a href="/state(.*?)/(.*?).asp',1)
$Url = 'http://www.weather.com/weather/today/' & $City[1] & '+' & $State[1] & '+' & $Zipcode
Global $h_Desktop_SysListView32
_GetDesktopHandle()
$Width = @DesktopWidth
$Height = @DesktopHeight
_GetOverViewTimes()
    _GetOverViewTemperature()
    _GetOverViewImages()
    _GetOverViewStatus()
$RefreshRate = InputBox("Refresh Rate", "Please input a numerical value of 1-60." & @CRLF & @CRLF & "1 being one minute, 60 being an hour." & @CRLF & @CRLF & "This will be your refresh time for the Weather Widget","","",350,250)
If $RefreshRate = 0 Then
  MsgBox(48,"Refresh Rate", "You've selected to have no refresh rate. To refresh the Weather Widget you may right click on it and select 'Refresh'")
  _RightNowGUI()
Else
For $i = 1 To $RefreshRate Step +1
  $RefreshTime += 60000
Next
AdlibRegister("_Refresh", $RefreshTime)
_RightNowGUI()
EndIf
Func _RightNowGUI()
    GuiDelete($RightNowGUI)
    GuiDelete($TodayGUI)
    GuiDelete($TonightGUI)
    GuiDelete($TomorrowGUI)
    $RightNowGUI = GUICreate("", 150, 300, $Width-151, $Height-600, BitOR($WS_POPUP,$WS_BORDER), Default, WinGetHandle(AutoItWinGetTitle()))
    GuiSetFont(13)
    GUICtrlSetDefColor(0xFFFFFF)
    GUISetBkColor(0x000000)
    WinSetTrans($RightNowGUI,"",200)
    GuiSetState()
    GuiCtrlCreateLabel($OverViewTime[1],38,10,200,50)
For $i = 1 To $Statuses[0][0]
  If $Statuses[$i][1] = $OverViewStatus[1] Then
   For $i = 1 To $XY[0][0]
    If $XY[$i][0] = $OverViewStatus[1] Then
     $Split = StringSplit($XY[$i][1],",")
    EndIf
   Next
   GuiCtrlCreateLabel($OverViewStatus[1],$Split[1],$Split[2])
   GuiCtrlSetFont(-1,7.8)
  EndIf
  Next
    GuiCtrlCreateLabel("Temperature",35,230,200,40)
    GuiCtrlCreateLabel($OverViewTemp[1] & "°F",64,250,200,40)
    $ContextMenu = GuiCtrlCreateContextMenu()
    $RightNowItem = GuiCtrlCreateMenuItem($OverViewTime[1], $ContextMenu)
    GUICtrlSetOnEvent($RightNowItem, "_RightNowGUI")
    $TodayItem = GuiCtrlCreateMenuItem($OverViewTime[2], $ContextMenu)
    GUICtrlSetOnEvent($TodayItem, "_TodayGUI")
    $TonightItem = GuiCtrlCreateMenuItem($OverViewTime[3], $ContextMenu)
    GUICtrlSetOnEvent($TonightItem, "_TonightGUI")
    $TomorrowItem = GuiCtrlCreateMenuItem($OverViewTime[4], $ContextMenu)
    GUICtrlSetOnEvent($TomorrowItem, "_TomorrowGUI")
    $RefreshItem = GuiCtrlCreateMenuItem("Refresh", $ContextMenu)
    GUICtrlSetOnEvent($RefreshItem, "_Refresh")
    $ExitItem = GuiCtrlCreateMenuItem("Close", $ContextMenu)
    GUICtrlSetOnEvent($ExitItem, "_Exit")
    DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $RightNowGUI, "hwnd", $h_Desktop_SysListView32)
    _GDIPlus_StartUp()
    $hImage   = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/Images/Image1.png")
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($RightNowGUI)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 13, 35, 130,160)
EndFunc
Func _TodayGUI()
    GuiDelete($RightNowGUI)
    GuiDelete($TodayGUI)
    GuiDelete($TonightGUI)
    GuiDelete($TomorrowGUI)
    $TodayGUI = GUICreate("", 150, 300, $Width-151, $Height-600, BitOR($WS_POPUP,$WS_BORDER), Default, WinGetHandle(AutoItWinGetTitle()))
    GuiSetFont(13)
    GUICtrlSetDefColor(0xFFFFFF)
    GUISetBkColor(0x000000)
    WinSetTrans($TodayGui,"",200)
     GuiSetState()
For $i = 1 To $Statuses[0][0]
  If $Statuses[$i][1] = $OverViewStatus[2] Then
   For $i = 1 To $XY[0][0]
    If $XY[$i][0] = $OverViewStatus[2] Then
     $Split = StringSplit($XY[$i][1],",")
    EndIf
   Next
   GuiCtrlCreateLabel($OverViewStatus[2],$Split[1],$Split[2])
   GuiCtrlSetFont(-1,7.8)
  EndIf
  Next
If $OverViewTime[2] = "Today" Then
    GuiCtrlCreateLabel($OverViewTime[2], 48,10,200,50)
ElseIf $OverViewTime[2] = "Tonight" Then
GuiCtrlCreateLabel($OverViewTime[2], 45,10,200,50)
Else
MsgBox(0, "Test", "Error")
EndIf
    GuiCtrlCreateLabel("Temperature",35,230,200,40)
    GuiCtrlCreateLabel($OverViewTemp[2] & "°F",64,250,200,40)
     $ContextMenu = GuiCtrlCreateContextMenu()
    $RightNowItem = GuiCtrlCreateMenuItem($OverViewTime[1], $ContextMenu)
    GUICtrlSetOnEvent($RightNowItem, "_RightNowGUI")
    $TodayItem = GuiCtrlCreateMenuItem($OverViewTime[2], $ContextMenu)
    GUICtrlSetOnEvent($TodayItem, "_TodayGUI")
    $TonightItem = GuiCtrlCreateMenuItem($OverViewTime[3], $ContextMenu)
    GUICtrlSetOnEvent($TonightItem, "_TonightGUI")
    $TomorrowItem = GuiCtrlCreateMenuItem($OverViewTime[4], $ContextMenu)
    GUICtrlSetOnEvent($TomorrowItem, "_TomorrowGUI")
    $RefreshItem = GuiCtrlCreateMenuItem("Refresh", $ContextMenu)
    GUICtrlSetOnEvent($RefreshItem, "_Refresh")
    $ExitItem = GuiCtrlCreateMenuItem("Close", $ContextMenu)
    GUICtrlSetOnEvent($ExitItem, "_Exit")
    DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $RightNowGUI, "hwnd", $h_Desktop_SysListView32)
     _GDIPlus_StartUp()
    $hImage   = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/Images/Image2.png")
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($TodayGUI)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 13, 35, 130,160)
EndFunc
Func _TonightGUI()
    GuiDelete($RightNowGUI)
    GuiDelete($TodayGUI)
    GuiDelete($TonightGUI)
    GuiDelete($TomorrowGUI)
    $TonightGUI = GUICreate("", 150, 300, $Width-151, $Height-600, BitOR($WS_POPUP,$WS_BORDER), Default, WinGetHandle(AutoItWinGetTitle()))
    GuiSetFont(13)
    GUICtrlSetDefColor(0xFFFFFF)
    GUISetBkColor(0x000000)
    WinSetTrans($TonightGui,"",200)
GuiSetState()
For $i = 1 To $Statuses[0][0]
  If $Statuses[$i][1] = $OverViewStatus[3] Then
   For $i = 1 To $XY[0][0]
    If $XY[$i][0] = $OverViewStatus[3] Then
     $Split = StringSplit($XY[$i][1],",")
    EndIf
   Next
   GuiCtrlCreateLabel($OverViewStatus[3],$Split[1],$Split[2])
   GuiCtrlSetFont(-1,7.8)
  EndIf
  Next
If $OverViewTime[3] = "Tonight" Then
    GuiCtrlCreateLabel($OverViewTime[3], 48,10,200,50)
ElseIf $OverViewTime[3] = "Tomorrow" Then
GuiCtrlCreateLabel($OverViewTime[3], 43,10,200,50)
Else
MsgBox(0, "Test", "Error")
EndIf
    GuiCtrlCreateLabel("Temperature",35,230,200,40)
    GuiCtrlCreateLabel($OverViewTemp[3] & "°F",64,250,200,40)
    $ContextMenu = GuiCtrlCreateContextMenu()
    $RightNowItem = GuiCtrlCreateMenuItem($OverViewTime[1], $ContextMenu)
    GUICtrlSetOnEvent($RightNowItem, "_RightNowGUI")
    $TodayItem = GuiCtrlCreateMenuItem($OverViewTime[2], $ContextMenu)
    GUICtrlSetOnEvent($TodayItem, "_TodayGUI")
    $TonightItem = GuiCtrlCreateMenuItem($OverViewTime[3], $ContextMenu)
    GUICtrlSetOnEvent($TonightItem, "_TonightGUI")
    $TomorrowItem = GuiCtrlCreateMenuItem($OverViewTime[4], $ContextMenu)
    GUICtrlSetOnEvent($TomorrowItem, "_TomorrowGUI")
    $RefreshItem = GuiCtrlCreateMenuItem("Refresh", $ContextMenu)
    GUICtrlSetOnEvent($RefreshItem, "_Refresh")
    $ExitItem = GuiCtrlCreateMenuItem("Close", $ContextMenu)
    GUICtrlSetOnEvent($ExitItem, "_Exit")
    DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $RightNowGUI, "hwnd", $h_Desktop_SysListView32)
     _GDIPlus_StartUp()
    $hImage   = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/Images/Image3.png")
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($TonightGUI)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 13, 35, 130,160)
EndFunc
Func _TomorrowGUI()
    GuiDelete($RightNowGUI)
    GuiDelete($TodayGUI)
    GuiDelete($TonightGUI)
    GuiDelete($TomorrowGUI)
    $TomorrowGUI = GUICreate("", 150, 300, $Width-151, $Height-600, BitOR($WS_POPUP,$WS_BORDER), Default, WinGetHandle(AutoItWinGetTitle()))
    GuiSetFont(13)
    GUICtrlSetDefColor(0xFFFFFF)
    GUISetBkColor(0x000000)
    WinSetTrans($TomorrowGui,"",200)
GuiSetState()
For $i = 1 To $Statuses[0][0]
  If $Statuses[$i][1] = $OverViewStatus[4] Then
   For $i = 1 To $XY[0][0]
    If $XY[$i][0] = $OverViewStatus[4] Then
     $Split = StringSplit($XY[$i][1],",")
    EndIf
   Next
   GuiCtrlCreateLabel($OverViewStatus[4],$Split[1],$Split[2])
   GuiCtrlSetFont(-1,7.8)
  EndIf
  Next
If $OverViewTime[4] = "Tomorrow" Then
    GuiCtrlCreateLabel($OverViewTime[4], 45,10,200,50)
ElseIf $OverViewTime[4] = "Tomorrow Night" Then
GuiCtrlCreateLabel($OverViewTime[4], 22,10,200,50)
EndIf
    GuiCtrlCreateLabel("Temperature",35,230,200,40)
    GuiCtrlCreateLabel($OverViewTemp[4] & "°F",64,250,200,40)
    $ContextMenu = GuiCtrlCreateContextMenu()
    $RightNowItem = GuiCtrlCreateMenuItem($OverViewTime[1], $ContextMenu)
    GUICtrlSetOnEvent($RightNowItem, "_RightNowGUI")
    $TodayItem = GuiCtrlCreateMenuItem($OverViewTime[2], $ContextMenu)
    GUICtrlSetOnEvent($TodayItem, "_TodayGUI")
    $TonightItem = GuiCtrlCreateMenuItem($OverViewTime[3], $ContextMenu)
    GUICtrlSetOnEvent($TonightItem, "_TonightGUI")
    $TomorrowItem = GuiCtrlCreateMenuItem($OverViewTime[4], $ContextMenu)
    GUICtrlSetOnEvent($TomorrowItem, "_TomorrowGUI")
    $RefreshItem = GuiCtrlCreateMenuItem("Refresh", $ContextMenu)
    GUICtrlSetOnEvent($RefreshItem, "_Refresh")
    $ExitItem = GuiCtrlCreateMenuItem("Close", $ContextMenu)
    GUICtrlSetOnEvent($ExitItem, "_Exit")
    DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $RightNowGUI, "hwnd", $h_Desktop_SysListView32)
_GDIPlus_StartUp()
    $hImage   = _GDIPlus_ImageLoadFromFile(@ScriptDir & "/Images/Image4.png")
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($TomorrowGUI)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 13, 35, 130,160)
EndFunc
Func _Quit()
    Exit
EndFunc
While 1
    Sleep(10)
WEnd

Func _GetDesktopHandle()
    $h_Desktop_SysListView32 = 0
    Local Const $hDwmApiDll = DllOpen("dwmapi.dll")
    Local $sChkAero = DllStructCreate("int;")
    DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero))
    Local $aero_on = DllStructGetData($sChkAero, 1)
    If Not $aero_on Then
        $h_Desktop_SysListView32 = WinGetHandle("Program Manager")
        Return 1
    Else
        Local $hCBReg = DllCallbackRegister("_GetDesktopHandle_EnumChildWinProc", "hwnd", "hwnd;lparam")
        If $hCBReg = 0 Then Return SetError(2)
        DllCall("user32.dll", "int", "EnumChildWindows", "hwnd", _WinAPI_GetDesktopWindow(), "ptr", DllCallbackGetPtr($hCBReg), "lparam", 101)
        Local $iErr = @error
        DllCallbackFree($hCBReg)
        If $iErr Then
            Return SetError(3, $iErr, "")
        EndIf
        Return 2
    EndIf
EndFunc
Func _Refresh()
_GetOverViewTimes()
    _GetOverViewTemperature()
    _GetOverViewImages()
    _GetOverViewStatus()
    _RightNowGUI()
EndFunc
Func _Exit()
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_ShutDown()
    Exit
EndFunc

And here is the UDF

#include <array.au3>
#Include-Once
Global $OverViewTemp[10], $OverViewImage[5], $OverViewStatus[5], $OverViewTime[5]
Global $Url, $RightNowImage, $TodayImage, $TonightImage, $TomorrowImage
Func _GetOverViewTimes()
Global $sSource = BinaryToString(InetRead($Url))
For $i = 1 To 5
If $i = 1 Then
  $Time1 = StringRegExp($sSource,'(?i)(?s)<span class="twc-forecast-when twc-none">(.*?)</span>',1)
ElseIf $i = 2 Then
  $Time2 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-2 twc-forecast-when">(.*?)</td>',1)
ElseIf $i = 3 Then
  $Time3 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-3 twc-forecast-when">(.*?)</td>',1)
ElseIf $i = 4 Then
  $Time4 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-4 twc-forecast-when">(.*?)</td>',1)
EndIf
Next
For $i = 1 To 4
If $i = 1 Then
$OverViewTime[1] = $Time1[0]
ElseIf $i = 2 Then
$OverViewTime[2] = $Time2[0]
ElseIf $i = 3 Then
$OverViewTime[3] = $Time3[0]
ElseIf $i = 4 Then
$OverViewTime[4] = $Time4[0]
EndIf
Next
EndFunc
Func _GetOverViewTemperature()
Global $sSource = BinaryToString(InetRead($Url))
For $i = 1 To 5
If $i = 1 Then
  $Temp1 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-1 twc-forecast-temperature"><strong>(.*?)&deg',1)
ElseIf $i = 2 Then
  $Temp2 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-2 twc-forecast-temperature"><strong>(.*?)&deg',1)
ElseIf $i = 3 Then
  $Temp3 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-3 twc-forecast-temperature"><strong>(.*?)&deg',1)
ElseIf $i = 4 Then
  $Temp4 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-4 twc-forecast-temperature"><strong>(.*?)&deg',1)
EndIf
Next
For $i = 1 To 4
If $i = 1 Then
$OverViewTemp[1] = $Temp1[0]
ElseIf $i = 2 Then
$OverViewTemp[2] = $Temp2[0]
ElseIf $i = 3 Then
$OverViewTemp[3] = $Temp3[0]
ElseIf $i = 4 Then
$OverViewTemp[4] = $Temp4[0]
EndIf
Next
EndFunc
Func _GetOverViewImages()
Global $sSource = BinaryToString(InetRead($Url))
$Image1 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 1.*-->", 1)
$Image2 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 2.*-->", 1)
$Image3 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 3.*-->", 1)
$Image4 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 4.*-->", 1)
For $i = 1 To 4
If $i = 1 Then
$OverViewImage[1] = $Image1[0]
ElseIf $i = 2 Then
$OverViewImage[2] = $Image2[0]
ElseIf $i = 3 Then
$OverViewImage[3] = $Image3[0]
ElseIf $i = 4 Then
$OverViewImage[4] = $Image4[0]
EndIf
Next
For $i = 1 To 4
If $i = 1 Then
  FileDelete(@ScriptDir & "\Images\Image1.png")
  $RightNowImage = InetGet($OverViewImage[1], @ScriptDir & "\Images\Image1.png")
EndIf
If $i = 2 Then
  FileDelete(@ScriptDir & "\Images\Image2.png")
  $TodayImage = InetGet($OverViewImage[2], @ScriptDir & "\Images\Image2.png")
EndIf
If $i = 3 Then
  FileDelete(@ScriptDir & "\Images\Image3.png")
  $TonightImage = InetGet($OverViewImage[3], @ScriptDir & "\Images\Image3.png")
EndIf
If $i = 4 Then
  FileDelete(@ScriptDir & "\Images\Image4.png")
  $TomorrowImage = InetGet($OverViewImage[4], @ScriptDir & "\Images\Image4.png")
EndIf
Next
EndFunc
Func _GetOverViewStatus()
Global $sSource = BinaryToString(InetRead($Url))
For $i = 1 To 4
If $i = 1 Then
  $Status1Start = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-1(.*?)<!-- Column 1 -->',1)
  $Status1 = StringRegExp($Status1Start[0],'(?i)(?s)alt="(.*?)"',1)
ElseIf $i = 2 Then
  $Status2 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-2 ">(.*?)</td>',1)
ElseIf $i = 3 Then
  $Status3 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-3 ">(.*?)</td>',1)
ElseIf $i = 4 Then
  $Status4 = StringRegExp($sSource,'(?i)(?s)<td class="twc-col-4 ">(.*?)</td>',1)
EndIf
Next
For $i = 1 To 4
If $i = 1 Then
$OverViewStatus[1] = $Status1[0]
ElseIf $i = 2 Then
$OverViewStatus[2] = $Status2[0]
ElseIf $i = 3 Then
$OverViewStatus[3] = $Status3[0]
ElseIf $i = 4 Then
$OverViewStatus[4] = $Status4[0]
EndIf
Next
EndFunc

You won't be able to see that labels for $OverViewStatus because the INI isn't included. If need be I'll upload it.

So in the UDF this is the section for images.

Func _GetOverViewImages()
Global $sSource = BinaryToString(InetRead($Url))
$Image1 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 1.*-->", 1)
$Image2 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 2.*-->", 1)
$Image3 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 3.*-->", 1)
$Image4 = StringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 4.*-->", 1)
For $i = 1 To 4
If $i = 1 Then
$OverViewImage[1] = $Image1[0]
ElseIf $i = 2 Then
$OverViewImage[2] = $Image2[0]
ElseIf $i = 3 Then
$OverViewImage[3] = $Image3[0]
ElseIf $i = 4 Then
$OverViewImage[4] = $Image4[0]
EndIf
Next
For $i = 1 To 4
If $i = 1 Then
  FileDelete(@ScriptDir & "\Images\Image1.png")
  $RightNowImage = InetGet($OverViewImage[1], @ScriptDir & "\Images\Image1.png")
EndIf
If $i = 2 Then
  FileDelete(@ScriptDir & "\Images\Image2.png")
  $TodayImage = InetGet($OverViewImage[2], @ScriptDir & "\Images\Image2.png")
EndIf
If $i = 3 Then
  FileDelete(@ScriptDir & "\Images\Image3.png")
  $TonightImage = InetGet($OverViewImage[3], @ScriptDir & "\Images\Image3.png")
EndIf
If $i = 4 Then
  FileDelete(@ScriptDir & "\Images\Image4.png")
  $TomorrowImage = InetGet($OverViewImage[4], @ScriptDir & "\Images\Image4.png")
EndIf
Next
EndFunc

Thanks for the help, not sure whats going on here.

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

It would be better if you posted some code we could run to see the problem.

Maybe you should be using _GDIPlus_ImageDispose($hImage) before you try to use _GDIPlus_ImageLoadFromFile again.

Same with $hGraphic, I would use _GDIPlus_GraphicsDispose($hGraphic) before I used _GDIPlus_GraphicsCreateFromHWND another time. (But I'm no expert on GDIPlus).

I don't know what the effect of using _GDIPlus_Startup() repeatedly is unless you have used _GDIPlus_ShutDown, but it doesn't look like a good idea to me.

I think it would be better to create all the windows and gui components only once and not delete them every time you wanted to refresh the images.

So I would copy the _RightNow function to a new function,say StartupGui, and call that once. Delete all the gui creation stuff and the GDIPlus_Startup from the __RightNowGUI function, and at the start add the _GDIPlus_ImageDispose($hImage) and _GDIPlus_GraphicsDispose($hGraphic).

When all that makes no difference I will be nowhere to be seen :oops:. But seriously, that is only my suggestion, I don't know if it will fix your problem or not.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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