Sign in to follow this  
Followers 0
Magellan

How To embed a JPG with Koda ?

6 posts in this topic

Hello,

I'd like to display a logo in my GUI without having to distribute the jpg file. I'd like to embed this jpg file in the exe script file.

I read in this forum that it was possible in this way :

$Ball_pic = @TempDir & "\Ball-pic.jpg"

FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\Curveball.jpg", $Ball_pic)

My question is : Does Koda can handle this natively ?

Thanks.

Share this post


Link to post
Share on other sites



i dont hink it does... i got this from KODA

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("AForm1", 622, 441, 192, 125)
$Pic1 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\My Stuff\15601173.gif", 40, 56, 281, 185)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd
Exit

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

i dont hink it does... i got this from KODA

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("AForm1", 622, 441, 192, 125)
$Pic1 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\My Stuff\15601173.gif", 40, 56, 281, 185)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit

8)

Thank you very much for your answer.

Unfortunately, in the way proposed by Koda, the "15601173.gif" must be in the path "C:\Program Files\AutoIt3\Examples\My Stuff\" and can't be embedded in the exe file.

Nerver mind, I'll use the FileInstall instruction in my AutoIt code and not in Koda.

Thanks again ;-)

Share this post


Link to post
Share on other sites

There is an alternative...

I remember having seen a script submitted by erifash called "AutoIt Art" in the Scirpts and Scraps, but can't find it. I downloaded it ages ago, but it might be better if you send him a pm as he might have done some changes to it.

Good luck

IVAN

Share this post


Link to post
Share on other sites

I don't think that's going to do it Ivan, from what I remember that read the pixels of a file, he doesn't seem to want to have to use a path... LoadImage may help, if I remember right tonedeaf had a way to do this... Found it: http://www.autoitscript.com/forum/index.ph...st&p=203415


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I think it depends on the intention, if Magellan doesn't want to distribute the file, he could always run the script on his computer and get the resulting code saved to an array. On the compiled script he could reproduce the image without having to distribute the file.

Then again, it's only an idea that has to be tried. I loved the script and I found it so hard to locate, thanks for finding it.

IVAN

PS: Magellan, the image is not as neat as the original, from what I remember. Most of the time people are really concerned about how logos are displayed, and it is preferible to display a neat logo rather than a distorted image.

Edited by ivan

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