How can I insert an image in this splashtext?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

How can I insert an image in this splashtext?

Post by empardopo » 06 Oct 2013, 12:54

In another forum I've posted this question...

I have found this source

Code: Select all

ScrollText =
(


AutoHotkey is a free, open-source utility for Windows. 

With it, you can:

Automate almost anything by sending keystrokes and mouse
clicks. You can write macros by hand or use the macro recorder. 

Create hotkeys for keyboard, joystick, and mouse. Virtually any
key, button, or combination can become a hotkey. 

Expand abbreviations as you type them. For example, typing "btw" 
can automatically produce "by the way". 

Create custom data entry forms, user interfaces, and menu bars. 

Remap keys and buttons on your keyboard, joystick, and mouse. 

Respond to signals from hand-held remote controls via the WinLIRC
client script. 

Run existing AutoIt v2 scripts and enhance them with new capabilities. 

Convert any script into an EXE file that can be run on computers 
that don't have AutoHotkey installed. 



)

Gui, Margin, 0,0 
Gui +LastFound 
GUI_ID:=WinExist() 
Gui, -Caption +AlwaysOnTop +Border
Gui, Color, FFFFFF
Gui, Margin, 40, 40
Gui, Font, s12 Bold, Verdana

Gui, Add, Text, x41 y41 c808080 BackGroundTrans, % ScrollText
Gui, Add, Text, x40 y40 c000000 BackGroundTrans, % ScrollText

Gui,Show, AutoSize Hide, Animated Splash Window - Demo 

DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x40008") 
DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x50008") 
ExitApp
My question is if is it possible insert an image in the scrolltext? No problem with without breaking the text up into two variables. How could I solved it?

Thanks in advance.
Everything is possible!

Wade Hatler
Posts: 60
Joined: 03 Oct 2013, 19:49
Location: Seattle Area
Contact:

Re: How can I insert an image in this splashtext?

Post by Wade Hatler » 06 Oct 2013, 13:02

There's probably a really clever way to do it with GUI commands, but I'd probably punt and use an HTML control. That would give you really rich control over the look very easily. There are a couple examples on the forum. Here's a little fragment that will do it from HTML in a file or in a variable.

Code: Select all

Gui Add, ActiveX, h%ctlH% w%ctlW% vWB, Shell.Explorer
if(MsgFile) {
    WB.Navigate(MsgFile)
}
else {
    WB.Navigate("about:blank")
    WB.Document.write(Message)
}

User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How can I insert an image in this splashtext?

Post by empardopo » 06 Oct 2013, 13:24

I'm sorry but I don't understand this code.
Please, where is the complete example? Could you give me the link?

Thanks in advance!
Everything is possible!

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: How can I insert an image in this splashtext?

Post by Zelio » 06 Oct 2013, 16:01

He say that you can use Html page code , online or not, to create a page and display it in a window, like this

Code: Select all

Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist()
Gui, -Caption +AlwaysOnTop +Border

Gui, Add, ActiveX, w980 h640 vWB BackGroundTrans, Shell.Explorer
WB.Navigate("http://www.auto-hotkey.com")
while, WB.ReadyState != 4
	sleep, 1

Gui,Show, AutoSize Hide, Animated Splash Window - HTML online Demo

DllCall("AnimateWindow","UInt",GUI_ID,"Int",5000,"UInt","0x40008")
DllCall("AnimateWindow","UInt",GUI_ID,"Int",5000,"UInt","0x50008")
ExitApp
Else, a simple way is to remplace the central part of your code by what lines you want

Code: Select all

gui, add, text, , my first part
gui, add, picture, , my_image.png
gui, add, text, , my second part

; or to play with w and y

gui, add, text, x0 y0, my text
gui, add, picture, x100 y100, my_image.png

Wade Hatler
Posts: 60
Joined: 03 Oct 2013, 19:49
Location: Seattle Area
Contact:

Re: How can I insert an image in this splashtext?

Post by Wade Hatler » 06 Oct 2013, 17:33

Zelio's example is very good, so go with that.

You can replace the URL with a filename for a local file. You can build the HTML file with any decent web editor, or a text editor if you know basic HTML. You wait for ReadyState == 4 if you want to do something after the text is rendered, such as the animation in the example.

If the HTML text is in a variable instead of a file, you would use the 'else' clause from my example, e.g.

Code: Select all

myHtml := "<HTML....
WB.Navigate("about:blank")
WB.Document.write(Message)
That puts the same HTML text into the control from memory instead of a file. It's easier if you have to calculate the code at runtime.

User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How can I insert an image in this splashtext?

Post by empardopo » 07 Oct 2013, 07:15

Thanks very much.
Finally, this is my source

Code: Select all

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

ScrollText =
(


AutoHotkey is a free, open-source utility for Windows.

With it, you can:

Automate almost anything by sending keystrokes and mouse
clicks. You can write macros by hand or use the macro recorder.

Create hotkeys for keyboard, joystick, and mouse. Virtually any
key, button, or combination can become a hotkey.

)

ScrollText2 =
(
Expand abbreviations as you type them. For example, typing "btw"
can automatically produce "by the way".

Create custom data entry forms, user interfaces, and menu bars.

Remap keys and buttons on your keyboard, joystick, and mouse.

Respond to signals from hand-held remote controls via the WinLIRC
client script.

Run existing AutoIt v2 scripts and enhance them with new capabilities.

Convert any script into an EXE file that can be run on computers
that don't have AutoHotkey installed.



)

Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist()
Gui, -Caption +AlwaysOnTop +Border
Gui, Color, FFFFFF
Gui, Margin, 40, 40
Gui, Font, s12 Bold blue, Verdana

Gui, Add, Text, x41 y41 c808080 BackGroundTrans, % ScrollText
Gui, Add, Text, x40 y40 c000000 BackGroundTrans, % ScrollText
Gui, Add, picture, x41 y251 c808080 BackGroundTrans, meter2.gif
Gui, Add, picture, x40 y250 c000000 BackGroundTrans, meter2.gif
Gui, Add, Text, x41 y551 c808080 BackGroundTrans, % ScrollText2
Gui, Add, Text, x41 y550 c000000 BackGroundTrans, % ScrollText2

Gui,Show, AutoSize Hide, Animated Splash Window - Demo

DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x40008")
DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x50008")
ExitApp
Another question! Is it possible to write in blue a word of my text?
Thanks in advance!
Everything is possible!

Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: How can I insert an image in this splashtext?

Post by Guest10 » 07 Oct 2013, 08:41

tested and this is an impressive special-effect work! how can i speed up or change the scroll speed? also, how can i change the font format/style (size, color, etc.)?
empardopo wrote:Thanks very much.
Finally, this is my source

Code: Select all

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

ScrollText =
(


AutoHotkey is a free, open-source utility for Windows.

With it, you can:

Automate almost anything by sending keystrokes and mouse
clicks. You can write macros by hand or use the macro recorder.

Create hotkeys for keyboard, joystick, and mouse. Virtually any
key, button, or combination can become a hotkey.

)

ScrollText2 =
(
Expand abbreviations as you type them. For example, typing "btw"
can automatically produce "by the way".

Create custom data entry forms, user interfaces, and menu bars.

Remap keys and buttons on your keyboard, joystick, and mouse.

Respond to signals from hand-held remote controls via the WinLIRC
client script.

Run existing AutoIt v2 scripts and enhance them with new capabilities.

Convert any script into an EXE file that can be run on computers
that don't have AutoHotkey installed.



)

Gui, Margin, 0,0
Gui +LastFound
GUI_ID:=WinExist()
Gui, -Caption +AlwaysOnTop +Border
Gui, Color, FFFFFF
Gui, Margin, 40, 40
Gui, Font, s12 Bold blue, Verdana

Gui, Add, Text, x41 y41 c808080 BackGroundTrans, % ScrollText
Gui, Add, Text, x40 y40 c000000 BackGroundTrans, % ScrollText
Gui, Add, picture, x41 y251 c808080 BackGroundTrans, meter2.gif
Gui, Add, picture, x40 y250 c000000 BackGroundTrans, meter2.gif
Gui, Add, Text, x41 y551 c808080 BackGroundTrans, % ScrollText2
Gui, Add, Text, x41 y550 c000000 BackGroundTrans, % ScrollText2

Gui,Show, AutoSize Hide, Animated Splash Window - Demo

DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x40008")
DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x50008")
ExitApp
Another question! Is it possible to write in blue a word of my text?
Thanks in advance!

User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How can I insert an image in this splashtext?

Post by empardopo » 07 Oct 2013, 09:02

In this line

Code: Select all

DllCall("AnimateWindow","UInt",GUI_ID,"Int",20000,"UInt","0x40008")
change the 20000 value for another value and see the new speed!

In this other line

Code: Select all

Gui, Font, s12 Bold blue, Verdana
you can change the font format.

My question is how can write in blue a word!! The rest of my text in black!
Everything is possible!

Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: How can I insert an image in this splashtext?

Post by Zelio » 07 Oct 2013, 10:15

In fact, for speed or other informations go to http://msdn.microsoft.com/en-us/library ... 32669.aspx
Just use words my_function_I_Want with the word MSDN, that will work for a lot of dllcall :)

About your colored text, you have again two options, and can be annyoing and a long code if too much colors:
You split your text and you have to use a "Gui, Add, Text, cMYCOLOR, colored text" for each colored text you want.

Code: Select all

Gui, Add, Text, c800080, colored text 800080
Gui, Add, Text, c808080, colored text 808080
Gui, Add, Text, c008000, colored text c008000
some document help about your problem
http://auto-hotkey.com/docs/commands/Gu ... s.htm#Text
http://auto-hotkey.com/docs/commands/Gu ... herOptions
http://auto-hotkey.com/docs/commands/Gui.htm#PosSize

Or if you don't want one gui add per each color change then you can code an HTML page an write+navigate to it (as first example we gave)
about html code you can use open/libre/ms office (word) create a colored text and saved it to a .html or .htm, open the result file with a basic notepad (raw text) and you can copy-paste the code, you will have to use WB.Document.write(code) (you can see an example in this thread, and or do a google search), good luck...

User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: How can I insert an image in this splashtext?

Post by empardopo » 08 Oct 2013, 03:03

Thanks very much for your answer.
I'll take a look to the html method.
Everything is possible!

Post Reply

Return to “Ask for Help (v1)”