Jump to content

GUICtrlCreatePic not working


huajin
 Share

Go to solution Solved by UEZ,

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Solution

Check out post#3 and post#5 from that topic. FileInstall is not good for your case.

Br,

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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