Jump to content

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

good antialiased osd text ?


  • Please log in to reply
5 replies to this topic
erikals
  • Members
  • 7 posts
  • Last active: Nov 03 2015 08:18 PM
  • Joined: 26 Apr 2013

 

hi there,

 

i've been trying for some time to get smooth antialiased osd text (transparent background) in autohotkey,

this is not possible, right ?

 

transparent_text.png



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

There is like a GUI font option of "q4" or "q5" I believe that is anti-aliased text. You can try that out.

 

http://ahkscript.org...ds/Gui.htm#Font

 

Though, thinking about it, I used to use q3 for my transparent GUIs because the transparent trick wouldn't work. I have a midterm to study for, but after I take it tomorrow I can get back to you.

 

In the meantime, what is the code you are running?



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
The standard commands for transparency only support complete transparency for a specific colour, and one transparency level for everything else.

The only way to do what you want is to use a layered window. tic's GDI+ library includes functions for this. I wasn't able to find any good examples, but I'm sure I've seen some.

Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012

Here I think is an okay example topic Beginner question about text with GDI+

 

Here is a slight rewrite of the top example from that topic
 

#Include, Gdip.ahk
pToken := Gdip_Startup()
Width = 400
Height = 300
Options = x10p y30p w80p Centre cbb00FF00 r4 s50 Underline Italic
Text = Thank you for trying this example
Font = Arial

DetectHiddenWindows, On
Gui, 1:  -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
hwnd1 := WinExist()
hbm := CreateDIBSection(Width, Height)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetSmoothingMode(G, 4)
Gdip_SetInterpolationMode(G, 7)
Gdip_TextToGraphics(G, Text, Options, Font, Width, Height)
UpdateLayeredWindow(hwnd1, hdc, (A_ScreenWidth-Width)//2, (A_ScreenHeight-Height)//2, Width, Height)
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Gui, 1: Show, NA w500 h400
Return

Esc::
Gdip_Shutdown(pToken)
ExitApp

Alternative GDI+ Download: Gdip All ((beta) - Alternate variation of the lib that work for most versions of AHK like: 32, 64, unicode, ansi)


Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012
Whats with this? (SOLVED) Transparent gui + readable font

Edit:
nvm... bigger text => less quality
[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you

erikals
  • Members
  • 7 posts
  • Last active: Nov 03 2015 08:18 PM
  • Joined: 26 Apr 2013

@Exaskryz
thank you, yes, i did try that, and it worked nicely, however it's not possible when text is "outside" the GUI window (like in the shown example)

@Lexikos
thanks, yes, standard commands only working with a specific color is what kept me back.
i'm trying to stay away from GDI+ though, as i couldn't get it to work on my computer, and i don't want users to have to deal with those problems.
maybe if GDI+ was standard it wouldn't  occur? not sure.
an alternative is to jump to QuickTroll, but trying to avoid that...

@Jackie Sztuk _Blackholyman
thank you, if i look more into G+ i'll definitely take a second look.

 

 

sorry all for late reply, partly due to email subscription option was unchecked in the user setting (by default)

it'd be better if it was on by default imo, but that's for another thread.

 

thanks again all for helping!   :]