Našel jsem Vám API funkci na vykreslení svislého textu(není to sice do pictureboxu, ale myslím, že to zvládnete)
Private Const LOGPIXELSY = 90
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function MulDiv Lib "kernel32" (ByVal nNumber As Long, ByVal nNumerator As Long, ByVal nDenominator As Long) As Long
Private Declare Function CreateFont Lib "gdi32" Alias "CreateFontA" (ByVal nHeight As Long, ByVal nWidth As Long, ByVal nEscapement As Long, ByVal nOrientation As Long, ByVal fnWeight As Long, ByVal fdwItalic As Boolean, ByVal fdwUnderline As Boolean, ByVal fdwStrikeOut As Boolean, ByVal fdwCharSet As Long, ByVal fdwOutputPrecision As Long, ByVal fdwClipPrecision As Long, ByVal fdwQuality As Long, ByVal fdwPitchAndFamily As Long, ByVal lpszFace As String) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Function MyCreateFont(ByVal Font As String, ByVal Size As Long, ByVal Degrees As Integer) As Long
Dim nDC&, nHeight&
nDC = GetDC(0&)
nHeight = -MulDiv(Size, GetDeviceCaps(nDC, LOGPIXELSY), 72)
ReleaseDC 0&, nDC
MyCreateFont = CreateFont(nHeight, 0&, 10& * Degrees, 0&, 0&, False, False, False, 0&, 0&, 0&, 0&, 0&, Font)
End Function
Private Sub Form_Load()
m_Font = SelectObject(Me.hdc, MyCreateFont("Arial", 9, 90))
End Sub
Private Sub Form_Paint()
Me.CurrentX = 2000
Me.CurrentY = 2000
Me.Print "Hello World!"
End Sub
Přeji hezký den.
|