Search code examples
c#graphicssystem.drawingdrawstring

How do I draw double height text using Graphics.DrawString?


I am trying to emulate a POS printer with System.Drawing and one of the functions I need is to draw text at double height. Any idea how I can do this using .Net's Graphics class?

Do I need to draw the text twice as large and condense it or draw normal size and then stretch? Both seem like messy options but is there an alternative?


Solution

  • Look at the transformation matrix on the Graphics object - you can control horizontal and vertical scaling independently.