Jump to content

Way to add font stroke in paint?


computor

Recommended Posts

If you are truly stuck, there's a trick to achieving strokes and shadows in paint without any fancy stuff by drawing the text with the stroke color, then drawing the text again with a different color on top of it.

 

Usually, for shadows I just draw the text again with an offset of 1 pixel, so:

 

String msg = "Hello";

int x = 15, y = 15;

 

g.setColor(Color.BLACK);

drawString(msg, x + 1, y + 1);

g.setColor(Color.RED);

drawString(msg, x, y);

 

Thats for a basic shadow, however if you want a full stroke (like you mentioned in your thread) you must make additions to the above code so that it draws in every direction, not just + 1, example

 

drawString(msg, x + 1, y + 1);

drawString(msg, x, y + 1);
drawString(msg, x + 1, y);
 
however, from the looks of it, its drawing too many strings! So only use this if you are hopeless, it's really not that bad but its better than nothing.
Edited by Czar
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...