Jump to content

GUICtrlSetImage() producing corrupt image display


suthers
 Share

Recommended Posts

Hi All,

My GUI App has Pic controls created by GuiCtrlCreatePic(). Their content can be selected by the user clicking on radio buttons. It was previously compiled under V3.2.1.4 and worked. Running or compiling under Beta V3.2.13.9 the images become corrupted when GUICtrlSetImage() is called to change them. Pixels are missing, carried over from the previous image, etc. Multiple changes of image don't help. The corruptions are reproducable, not random. If the GUI window is hidden, then shown, or minimised then maximised, then the corruptions disapear....until the next time GUICtrlSetImage() is called to change them and then they corrupt again.

The full script is 1168 lines long and won't work outside its installation environment, so I'll post snippits below. If the full code would be useful I can send it directly to interested parties.

;control creation
$30DayImagePicID = GUICtrlCreatePic(@ScriptDir & "\gold30dayinit.gif", $30DayImageLeftAlign, $TopAlignGraph30Day, 250, 155)
$LiveImagePicID = GUICtrlCreatePic(@ScriptDir & "\goldliveinit.gif", $LiveImageLeftAlign, $TopAlignGraphLive, 640, 400)

;image changing - this function is called when the user changes the radio buttons in the GUI
Func UpdateGUIWithNewGraphs()
    If $ActiveGraphType = "gold" Then
        GUICtrlSetImage($30DayImagePicID, $GraphGold30dayFileAndPath)
        GUICtrlSetImage($LiveImagePicID, $GraphGoldLiveFileAndPath)
        FixCorruptedPicControls(); my workaround
    Else
        GUICtrlSetImage($30DayImagePicID, $GraphSilver30dayFileAndPath)
        GUICtrlSetImage($LiveImagePicID, $GraphSilverLiveFileAndPath)
        FixCorruptedPicControls(); my workaround
    EndIf
EndFunc  ;==>UpdateGUIWithNewGraphs

Func FixCorruptedPicControls(); this is my workaround for the new unicode autoit version which corrupts the image pic controls when changing pics
    GUISetState (@SW_HIDE,$MainGUIHandle)
    GUISetState (@SW_SHOW,$MainGUIHandle)
EndFunc

The workaround is not satisfactory as it introduces a BIG flicker (obviously).

Ideas?

Shalom

Bill

Link to comment
Share on other sites

It's not a background picture. They are actually being used as controls. They are clickable and trigger events. And there is no overlap with other controls.

Can you post a small and working example to duplicate the problem?
Link to comment
Share on other sites

Can you post a small and working example to duplicate the problem?

Mmmm...have thought about that and shuddered at trying to trim the code down to something neat & small. How do I include the images for the pic controls in the post? I'm at work at the moment, so no chance right now....

Edited by suthers
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...