This Dynamic SplashImage Demo uses Rajat's Dynamic SplashText
Routine to automatically adjust the width of the client window.
I thought I would try to apply Rajat's Dynamic SplashText routine to
automatically adjust the client window width produced by the
SplashImage command. It does work, but required some tweaking
of parameters.
The SplashImage Gui supports many more options for Text Formatting
then does the SplashText Gui, and thus can produce a much more
pleasing Display.
This Script is not an End Product designed to Automate your SplashImage
designs, but rather a Demo to illustrate that the SplashImage command
can be used for the Dynamic Display of Text.
As you would expect, changing some of the Text Formatting parameters
will likely require tweaking of the "charspace" variable assigned value,
and possibly other values as well.
The code is provided for your own experimentation.
; Dynamic SplashImage for Text using the Semi-Bold Arial Size 14 Font
bgColor = 0000FF
fgColor = FFFF00
Loop, 12
{
bb = %A_index%
stext =
Loop, %bb%
{
stext .= "Word " . A_Index
}
gosub, DynamicSplash
If len < 700 ; Fudge Factor adds a little extra width for shorter strings of text
len += 15
SplashImage,, w%len% b fs14 WS600 zh0 zy5 CT%fgColor% CW%bgColor%, %stext%,, Arial
Sleep, 999
}
SplashImage, Off
exit
DynamicSplash:
setenv, charspace, 11.5 ;set space taken per character in text here
setenv, linespace, 21 ;set space taken per line here
StringSplit, piece, stext, `n
setenv, len, 0
Loop, %piece0%
{
StringLen, len0, piece%A_Index%
ifgreater, len0, %len%, setenv, len, %len0%
}
setenv, lines, %piece0%
envmult,len, %charspace%
envmult,lines, %linespace%
envadd, len, 15
return




