'精彩100之VB源程序:
Private Type LOGFONT_TYPE
  lfHeight As Long
  lfWidth As Long
  lfEscapement As Long
  lfOrientation As Long
  lfWeight As Long
  lfItalic As Byte
  lfUnderline As Byte
  lfStrikeOut As Byte
  lfCharSet As Byte
  lfOutPrecision As Byte
  lfClipPrecision As Byte
  lfQuality As Byte
  lfPitchAndFamily As Byte
  lffacename As String * 32
End Type
Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT_TYPE) 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 LongPublic Sub RotateText(Degrees As Integer, obj As Object, fontname As String, Fontsize As Single, X As Integer, Y As Integer, Caption As String)
  Dim RotateFont As LOGFONT_TYPE
  Dim CurFont As Integer, rFont As Integer, foo As Integer
  RotateFont.lfEscapement = Degrees * 10
  RotateFont.lffacename = fontname & Chr$(0)
  If obj.FontBold Then
    RotateFont.lfWeight = 800
  Else
    RotateFont.lfWeight = 400
  End If
  RotateFont.lfHeight = (Fontsize * -20) / Screen.TwipsPerPixelY
  rFont = CreateFontIndirect(RotateFont)
  CurFont = SelectObject(obj.hdc, rFont)
  obj.CurrentX = X
  obj.CurrentY = Y
  obj.Print Caption
  'Restore
  foo = SelectObject(obj.hdc, CurFont)
  foo = DeleteObject(rFont)
End SubPrivate Sub Command1_Click(Index As Integer)
  Select Case Index
    Case 0
      RotateText HScroll1.Value, Picture1, "宋体", 16, Picture1.Width / 2, Picture1.Height / 2, "hello world"
    Case 1
      Picture1.Cls
  End Select
End SubPrivate Sub HScroll1_Change()
  Label2.Caption = HScroll1.Value
End SubPrivate Sub CommandExit_Click()
  End
End Sub

解决方案 »

  1.   

    解楼主的贴用一下!^_^,假如是picture呢?picture 上面printer了string
      

  2.   

    RotateText的Degrees为角度,范围0-360,使用该函数传递方法有多样,如text直接输入或listbox方法选择等。
      

  3.   

    zxrjx(白剑)  显示前在Picture1.Tag保存printer的字符串,用上例的清空和显示可处理。
      

  4.   

    RotateFont.lfEscapement = 度数 * 10我写的快速图像旋转程序:
    http://www.5ivb.net/zyl910/zyl910_Rotate.zip