Jump to content

Problem with beta: Code to show bitmap on tabitem does not work anymore


UTA
 Share

Recommended Posts

It's me again ;)

Now that I found a solution to my other problem (ListviewItem-Problem) by using the beta instead of the release-version I have a problem with the beta:

The following code is working fine with the release-version:

#include <GUIConstants.au3>

; Erzeuge Hauptformular
$MainFormHandle = GUICreate("Test2", 320, 250, -1, -1, -1, $WS_EX_TOPMOST)
$tab=GUICtrlCreateTab (10,10, 300, 230)
$tab0=GUICtrlCreateTabitem ("Heute")
$Logo_1 =           GUICtrlCreatePic("logo_r2_c1.jpg",20, 147, 0, 0)
$Logo_2 =           GUICtrlCreatePic("logo_r1_c2.jpg",215, 37, 0, 0)
GUICtrlCreateTabitem (""); end tabitem definition

; Hauptprozedur
GUISetState (@SW_SHOW, $MainFormHandle)
While 1
    $msg = GUIGetMsg()
 ; ========================================
 ; ========================================   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop   
Wend
Exit

BUT it is NOT with the beta: The two Logos (or JPGs; displace them by any other jpgs) are not displayed.

Is this also a bug (this time in the beta) or did I do something wrong?

(I thought typically the beta is getting MORE functions than less :lmao: )

UTA

Edited by UTA
Link to comment
Share on other sites

certainly your picture are not accessible when the script run.

test with the doc example :lmao:

;----- example 1 ----
#include <GUIConstants.au3>
GUICreate("My GUI picture",350,300,-1,-1,$WS_SIZEBOX+$WS_SYSMENU) ; will create a dialog box that when displayed is centered

GUISetBkColor (0xE0FFFF)
$n=GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg",50,50, 200,50)

GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend


GUISetState ()
; resize the control
$n=GUICtrlSetPos($n,50,50,200,100)
; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Link to comment
Share on other sites

First the important thing: I found the error!

But now the confusing thing:

1.

I replaced my lines of code...

$Logo_1 =            GUICtrlCreatePic("logo_r2_c1.jpg",20, 147, 0, 0)
$Logo_2 =            GUICtrlCreatePic("logo_r1_c2.jpg",215, 37, 0, 0)

...with this line:

$n=GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg",50,50, 200,50)

It worked!

2.

I copied my logos into the directory above (@Systemdir & "\oobe\images\") and replaced the new line with one of my old lines and adjusted the directory (to the same as above) to look in:

$Logo_1 =            GUICtrlCreatePic(@Systemdir & "\oobe\images\logo_r2_c1.jpg",20, 147, 0, 0)

It didn't work!

3.

Not really understanding the differences between the two lines I stumbled across the last two parameters in my lines:

....es\logo_r2_c1.jpg",20, 147, 0, 0)

After a short look into the helpfile I discovered that there was a reason, why I decided to set them to zero:

If you want to have a picture having the same size as the file content just use width=height=0.

Although I did that and it works fine with the release-version it do not work anymore with the beta.

4. After setting the width and height manually to the values of the picture, it was shown correctly.

I suppose that either the helpfile or the beta-release should be corrected.

UTA

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