Изменить угол наклона текста в зависимости от значения в numericUpDown - C#
Формулировка задачи:
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 строка
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static int x=0;
public static int y=0;
public static int corner=0;
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
x = e.X;
y = e.Y;
Refresh();
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
ValueType value = 0;
}
private void button1_Click(object sender, EventArgs e)
{
Graphics g = CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Red);
Font f = new Font("Arial", 16);
g.RotateTransform(corner);
g.DrawString("Abc", f, brush, x, y);
g.Dispose();
}
}
}Решение задачи: «Изменить угол наклона текста в зависимости от значения в numericUpDown»
textual
Листинг программы
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
x = e.X;
y = e.Y;
Graphics g = CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Red);
Font f = new Font("Arial", 16);
g.RotateTransform((int)numericUpDown1.Value);
g.DrawString("Abc", f, brush, x, y);
g.Dispose();
}