using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TextoVertical
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
string text1 = "Esto sirve para poco.";
string text2 = "Pero es bonito.";
FontFamily fontFamily = new FontFamily("Lucida Console");
Font font = new Font(fontFamily,14,FontStyle.Regular,GraphicsUnit.Point);
PointF linea1 = new PointF(100, 10);
PointF linea2 = new PointF(120, 10);
StringFormat stringFormat = new StringFormat();
SolidBrush solidBrush = new SolidBrush(Color.FromArgb(255, 0, 0, 255));
stringFormat.FormatFlags = StringFormatFlags.DirectionVertical;
e.Graphics.DrawString(text1, font, solidBrush, linea1, stringFormat);
e.Graphics.DrawString(text2, font, solidBrush, linea2, stringFormat);
}
}
}
No hay comentarios:
Publicar un comentario
Nota: solo los miembros de este blog pueden publicar comentarios.