Sign in to follow this  
Gink

Best way to scale text etc WinAPI?

Recommended Posts

Gink    100
What is the best way to do text scaling in the windows API? Like if I wanted to scale something like TextOut so it takes up the whole screen?

Share this post


Link to post
Share on other sites
Kippesoep    892
You could use StretchBlt, but that gives you mucho blockiness. The proper way to do it would simply be to create a font handle with a very large font. Read up on CreateFont on msdn.

Share this post


Link to post
Share on other sites
JY    289
Create a font bit enough to fill the whole screen and use TextOut. It will give you the best quality result. Stretching a bitmap is just going to make it all spectrum-like.

Share this post


Link to post
Share on other sites
Anon Mike    1098
You can also switch to switch to advanced mode (SetGraphicsMode(GM_ADVANCED)) and call SetWorldTransform to do scaling. The will scale everything in GDI though, not just text.

For good results you definitely want to be using a truetype font.

Share this post


Link to post
Share on other sites
Kippesoep    892
Quote:
Original post by Anon Mike
You can also switch to switch to advanced mode (SetGraphicsMode(GM_ADVANCED)) and call SetWorldTransform to do scaling. The will scale everything in GDI though, not just text.


It is also unavailable on Win9x, which may or may not be a concern.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this