반응형

c# -- winform 그래픽 ; 문자 세로로 그리기



환경 : visual studio 2013


참고 : https://msdn.microsoft.com/ko-kr/library/aa287525(v=vs.71).aspx







--


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);
}
}
}
}








반응형
Posted by 자유프로그램
,