我可以将面板和文本旋转 90º,它对我有用。但是旋转 180º 不起作用,我看不到文字。我能做些什么来修复它?
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));
}
}