Rotating Text on a Picture Box
Is there anyway to rotate text on a picture box other than using the vertical text flag like this? Custome angles would be nice too.
Richard
Is there anyway to rotate text on a picture box other than using the vertical text flag like this? Custome angles would be nice too.
Richard
Perhaps this will help you.
Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Const LF_FACESIZE = 32
Structure LOGFONT
Dim lfHeight As Long
Dim lfWidth As Long
Dim lfEscapement As Long
Dim lfOrientation As Long
Dim lfWeight As Long
Dim lfItalic As Byte
Dim lfUnderline As Byte
Dim lfStrikeOut As Byte
Dim lfCharSet As Byte
Dim lfOutPrecision As Byte
Dim lfClipPrecision As Byte
Dim lfQuality As Byte
Dim lfPitchAndFamily As Byte
Dim lfFaceName(LF_FACESIZE) As Byte
End Structure
Have a look at this control that I just whipped up:
public class TextControl : System.Windows.Forms.Control protected override void OnPaint(PaintEventArgs e) using (StringFormat format = new StringFormat(StringFormatFlags.DirectionVertical)) |