Jump to content


Photo

Dynamic SplashImage Demo


  • Please log in to reply
1 reply to this topic

#1 Larry

Larry
  • Members
  • 63 posts

Posted 22 August 2009 - 04:45 AM

Credits:
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


#2 awannaknow

awannaknow
  • Members
  • 369 posts

Posted 08 November 2010 - 02:53 PM


/*

Dynamic SplashImage for Text using the Semi-Bold Arial Size 14 Font 

Positionned on top of the screen

*/



bgColor = 0000FF 

fgColor = FFFF00 





stext = Word



gosub, DynamicSplash 

If len < 700 ; Fudge Factor adds a little extra width for shorter strings of text 

  len += 15 

SplashImage,, Y0 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