Jump to content
Sign in to follow this  

Refreshing pictures makes sunken control bigger?

Recommended Posts



I just discovered something strange. Don't know, if it's a bug or just me missing a piece.

When I update a picture control (GUICtrlCreatePic with $SS_SUNKEN style) with the same or a different picture over and over again, the picture control gets bigger! ;)

Without $SS_SUNKEN, it doesn't. Why is that?

Here's a example to demonstrate it.

Put a jpg file named 'pic.jpg' in @ScriptDir or use the attached one. *


#include <GuiConstants.au3>
#include <StaticConstants.au3>

Opt("GuiOnEventMode", 1)

GUICreate("Pic test?", 800, 360)
GUISetOnEvent($gui_event_close, "quit")

GUICtrlCreateLabel("NOT sunken", 10, 4, 380, 16, $ss_center)
GUICtrlCreateLabel("Sunken!", 410, 4, 380, 16, $ss_center)

$pic1 = GUICtrlCreatePic("", 10, 20, 380, 285)
$pic2 = GUICtrlCreatePic("", 410, 20, 380, 285, $ss_sunken)

$btn = GUICtrlCreateButton("Refresh picture", 10, 320, 185, 30)

GUICtrlSetOnEvent($btn, "showPic")

While True

Func showPic()
    GUICtrlSetImage($pic1, "pic.jpg")
    GUICtrlSetImage($pic2, "pic.jpg")

Func quit()


* Sorry, if I made you hungry, I just had this one nearby. :evil:


Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.