Sign in to follow this  
Followers 0

Refreshing pictures makes sunken control bigger?

1 post in this topic

Posted

Hi,

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. *

#NoTrayIcon

#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")

GUISetState()
While True
    Sleep(1000)
WEnd

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

Func quit()
    Exit
EndFunc

---

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

post-4403-12625644006194_thumb.jpg

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  
Followers 0