Jump to content

GUICtrlCreatePic not working


Go to solution Solved by UEZ,

Recommended Posts

Posted

There is a windows xp computer, a Guest user login, this user have no any write permission, run my script, GUICtrlCreatePic not work, picture no display.

i switch user who have some write permission, the GUICtrlCreatePic  have work, the picture display.

what is wrong??

  • Moderators
Posted

huajin,

Welcome to the AutoIt forums. :)

A little difficult to suggest without sight of the code, but are you using FileInstall to write the image to disk before displaying it? That would explain why it failed for the "no any write permission" user. ;)

If that is not the case, please post your code so we can take a better look - see here how to do it. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Func SelectWin()
    GUICreate("運行選擇", 572, 265, -1, -1, $WS_POPUP)
    
    GUICtrlCreatePic(@ScriptDir & "\Resource\02.jpg", 0, 0, 572, 265)
    
    GUISetState(@SW_SHOW)
    
    While 1
        Local $event = GUIGetMsg(1)
        If $event[0] == $GUI_EVENT_CLOSE Then
            Exit
        ElseIf $event[0] == $GUI_EVENT_PRIMARYUP And $event[3] >= 519 And $event[3] <= 559 And $event[4] >= 10 And $event[4] <= 49 Then
            Exit
        ElseIf $event[0] == $GUI_EVENT_PRIMARYUP And $event[3] >= 94 And $event[3] <= 197 And $event[4] >= 195 And $event[4] <= 235 Then
            GUIDelete()
            InstallWin()
        ElseIf $event[0] == $GUI_EVENT_PRIMARYUP And $event[3] >= 281 And $event[3] <= 465 And $event[4] >= 195 And $event[4] <= 235 Then
            Run(@ScriptDir & "\Setup\ebook.exe", @WorkingDir)
            WinWait("[CLASS:Qt5QWindowIcon]")
            GUIDelete()
            Exit
        EndIf
    WEnd
EndFunc   ;==>SelectWin

GUICtrlCreatePic(@ScriptDir & "Resource02.jpg", 0, 0, 572, 265) like this.

Posted (edited)

Guest user has probably no access rights to @ScriptDir & "Resource02.jpg". Best is to embedd the picture in your script and display it without saving to disk first.

There are several ways to do it: add picture as a resource or add it as a binary string.

Check out: '?do=embed' frameborder='0' data-embedContent>>

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted

  On 9/18/2014 at 7:11 AM, UEZ said:

Guest user has probably no access rights to @ScriptDir & "Resource02.jpg". Best is to embedd the picture in your script and display it without saving to disk first.

There are several ways to do it: add picture as a resource or add it as a binary string.

Check out: '?do=embed' frameborder='0' data-embedContent>>

Br,

UEZ

if use FileInstall, run exe, it will extra temp file to disk, but i have no any write permission, i think it will be failed.

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
  • Recently Browsing   0 members

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