Я могу поворачивать панель и текст 90º, и это работает для меня. Но поворот на 180º не работает, я не вижу текст. Что я могу сделать, чтобы исправить это?C# Поворот трансформации
else if (m_orientation == AfyLabelOrientation.TurnedLeft90)
{
e.Graphics.TranslateTransform(0, this.Height - 5);
e.Graphics.RotateTransform(270);
if (!TextShadow_)
{
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), new RectangleF(Padding.Left, Padding.Top, this.Height, this.Width));
}
else if (TextShadow_)
{
//Drawing text shadow
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(Color.Gray), new RectangleF(Padding.Left + 1, Padding.Top - 1, this.Height, this.Width));
//Drawing text
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), new RectangleF(Padding.Left, Padding.Top, this.Height, this.Width));
}
}
else if(m_orientation == AfyLabelOrientation.Overturned)//This don't work
{
e.Graphics.TranslateTransform(this.Width, 0);
e.Graphics.RotateTransform(180);
if (!TextShadow_)
{
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), new RectangleF(Padding.Left, Padding.Top, this.Height, this.Width));
}
else if (TextShadow_)
{
//text shadow
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(Color.Gray), new RectangleF(Padding.Left + 1, Padding.Top - 1, this.Height, this.Width));
//text
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), new RectangleF(Padding.Left, Padding.Top, this.Height, this.Width));
}
}
Не могли бы вы задать более четкий вопрос? Это, скорее всего, заявление – JonE
Как сделать Rotate by 180 работать правильно. – Zuhan
Возможно, когда вы вращаетесь, объект меняет свои координаты, его перевод. – Butzke