Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[How to] Display Shadowed Text in a GUI


  • Please log in to reply
3 replies to this topic
SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
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
kWo4Lk1.png

Dippy46
  • Members
  • 171 posts
  • Last active: Aug 17 2007 06:53 AM
  • Joined: 06 Jul 2004
Nice. Simple but effective. :wink:
Simple ideas lie within reach, only of complex minds

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

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, :)

Dippy46
  • Members
  • 171 posts
  • Last active: Aug 17 2007 06:53 AM
  • Joined: 06 Jul 2004
Hi Goyyah,
sorry about that, been v.busy. As the other posts say
"Keep 'em coming": excellent work ! :D

Regards Dave
Simple ideas lie within reach, only of complex minds