font outline

Posted on 2003-03-17
Medium Priority
Last Modified: 2013-12-03
Does anyone know if it is possible to create a image with text using 'Graphics.DrawString' or some other class or method, where the font has an outline in a different color?
Question by:Breedj
1 Comment

Accepted Solution

Nebulus_ earned 200 total points
ID: 8152686
this is tested into an Paint event of an pictureBox control:

string tstString = "Outlined String";
Font tstFont = new Font("Arial", 10);
int x0 = 10, y0 = 10;
SizeF strSize = e.Graphics.MeasureString(tstString, tstFont);
e.Graphics.DrawRectangle(Pens.Red, x0, y0, strSize.Width, strSize.Height) ;
e.Graphics.DrawString(tstString, tstFont, Brushes.Black, x0, y0);

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question