Jump to content

Adding images


Recommended Posts

when i try to run my script on my laptop the images didnt appear

i guess its because of the destination it been setted to

Global $Pic1 = GUICtrlCreatePic("C:\Users\Game\Downloads\45674853.gif", 96, 16, 145, 121, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

is there any way i can make it appear on other computer?

Link to comment
Share on other sites

That pic probably needs to be on, and in that specific location, whatever computer the script is run on.

i know, that was the problem, is there any other way i can do this?

because if its on another pc then there acc wouldnt be C:\User\Game

and they prob wouldnt have it on the download folder etc..

Link to comment
Share on other sites

use fileinstall and have the script delete the file when it exits.

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

use fileinstall and have the script delete the file when it exits.

i tried the fileinstall.. couldnt get it to work,

is there something wrong i done in my script?

$b = True
If $b = True Then FileInstall("C:\User\Game\Downloads\test.bmp", "D:\mydir\test.bmp")

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $Form1_1 = GUICreate("Tester", 294, 154, 189, 126)
Global $Pic1 = GUICtrlCreatePic("D:\mydir\test.jpg", 16, 16, 121, 121, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Button1 = GUICtrlCreateButton("button1", 168, 40, 113, 33, $WS_GROUP)
GUICtrlSetBkColor($Button1, 0xFF0000)
Global $Button2 = GUICtrlCreateButton("Note", 168, 88, 113, 33, $WS_GROUP)
GUICtrlSetBkColor($Button2, 0xFF0000)
GUISetState(@SW_SHOW)
Edited by XTensionX
Link to comment
Share on other sites

The script looks fine, but I was just testing some stuff with fileinstall, and I don't think that it will create a folder to put a file in. Are you sure that there is a D:\mydir folder on your laptop?

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

The script looks fine, but I was just testing some stuff with fileinstall, and I don't think that it will create a folder to put a file in. Are you sure that there is a D:\mydir folder on your laptop?

im not sure, i havnt got the laptop right now, i was testing it on my brother laptop..

im not quite sure how to use this fileinstall, havnt used it before

i tries=d making a seperate script with just the fileinstall so it dont get as confusing.. but when i compile it i get error saying 'error adding file C:\User\...'

how can i get the fileinstall to work?

Edit: got it to work now by using @ScriptDir

what is the code to delete the file it installed?

was thinking of filedelete but is there any other better way?

Edited by XTensionX
Link to comment
Share on other sites

  • Developers

what is the code to delete the file it installed?

was thinking of filedelete but is there any other better way?

Define better?

FileDelete deletes a file and isn't that what you want?

I would however not use @ScriptDir but always @Tempdir to ensure you have write access.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

People have to learn to do more conditional testing so trouble-shooting is easier.

$sDest = "D:\mydir\"
If NOT FileExists($sDest) Then DirCreate($sDest)
If @Error Then
    MsgBox(0, "Error", "Unable o create the destination folder.")
    Exit
EndIf
If FileExists("C:\User\Game\Downloads\test.bmp") Then
    If $b Then FileInstall("C:\User\Game\Downloads\test.bmp", $sDest)
Else
    MsgBox(0, "Error", "The file C:\User\Game\Downloads\test.bmp does not exist")
EndIf

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

thanks my script is working perfectly now..

just got this 1 last problem with the GUI, i tried both

Global $Pic1 = GUICtrlCreatePic("@ScriptDir & test.bmp", 24, 16, 129, 121,

and

Global $Pic1 = GUICtrlCreatePic("@TempDir & test.bmp", 24, 16, 129, 121,

but it couldnt locate the image to show on my GUI

Edited by XTensionX
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...