반응형
c# -- winform 그래픽 ; 문자 세로로 그리기
환경 : visual studio 2013
참고 : https://msdn.microsoft.com/ko-kr/library/aa287525(v=vs.71).aspx
--
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using System.Windows.Forms; | |
namespace vetical_text | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
this.DrawVerticalText(); | |
} | |
private void DrawVerticalText() | |
{ | |
String txt = "Sample 한글 .. 세로출력 @@ !!"; | |
StringFormat drawTextFormat = new StringFormat(StringFormatFlags.DirectionVertical); | |
using (Graphics g = this.CreateGraphics()) | |
using (Font font = new Font("Arial", 30)) | |
using (Brush brush = new SolidBrush(Color.Red)) | |
{ | |
g.DrawString(txt, font, brush, 100, 30, drawTextFormat); | |
} | |
} | |
} | |
} |
반응형
'C#' 카테고리의 다른 글
c# -- using 문 ( using Statement ) (0) | 2015.08.17 |
---|---|
C# -- 인쇄 #1 -- 텍스트 인쇄하기 (0) | 2015.08.17 |
C# -- Debug, Trace 사용하여 출력하기 (0) | 2015.08.12 |
c# -- winform, console 동시 사용하기 (0) | 2015.08.12 |
c# - 시스템 상태 확인 ; cpu, ram (0) | 2015.06.20 |