Jump to content


Photo

[How to] Display Shadowed Text in a GUI


  • Please log in to reply
3 replies to this topic

#1 SKAN

SKAN
  • Administrators
  • 9062 posts

Posted 26 March 2006 - 08:19 PM

How to Display Shadowed Text in a GUI ?
http://www.autohotke...pic.php?t=86414

Two Similar Texts (with transparent background) can be overlapped (superimposed)
one over the another (with a slight offset) to create an effect of shadowed text.
These texts have to be colored in contrast with each other.

The following example code displays a "Shadowed Text" in a GUI
Text= Shadowed
Gui, -Caption
Gui, Color, 5E43FF
Gui,Font, s36 Bold, Verdana
Gui, Add,Text,x4 y4 w384 h80 Center vText1 c000000 BackgroundTrans, % Text
Gui, Add,Text,x0 y0 w384 h80 Center vText2 cFFFFFF BackgroundTrans, % Text
Gui,Show,w400 h80
Return

GuiClose:
GuiEscape:
ExitApp
Return

The result of the above code:
Posted Image

Seen in the above snapshot - The White colored text is vertically and
horizontally offset from the Black colored text by 4 pixels.
This might be a good technique for large sized texts only.
I use this technique when scripting an Installer with AHK.

Compare these 2 snapshots taken from a working demo.

Posted Image
Want to try the Demo? You may download it : ST_Demo.ahk

How to Display OSD with Shadowed Text : Example code is here

#2 Dippy46

Dippy46
  • Members
  • 171 posts

Posted 26 March 2006 - 08:59 PM

Nice. Simple but effective. :wink:

#3 SKAN

SKAN
  • Administrators
  • 9062 posts

Posted 28 March 2006 - 08:51 PM

Nice. Simple but effective. :wink:


Dear Dave Perrée,

I had sent you a PM (just a thank note!), but I see you have not read it.

Thanks for the compliment! Regards, :)

#4 Dippy46

Dippy46
  • Members
  • 171 posts

Posted 31 March 2006 - 06:07 PM

Hi Goyyah,
sorry about that, been v.busy. As the other posts say
"Keep 'em coming": excellent work ! :D

Regards Dave