How to rotate Text 90 degrees, like for a graph legend 
Author Message
 How to rotate Text 90 degrees, like for a graph legend

I would appreciate suggestions on how to rotate Text 90 degrees, like for a
graph legend.

Thanks



Fri, 07 Jun 2002 03:00:00 GMT  
 How to rotate Text 90 degrees, like for a graph legend
Below is extracts of some bits of code I have for doing text rotate.  I
haven't tested this extract but read through it with the MSDN help for the
APIs and it should make sence.  Note that you can rotate the text line as
well as each character within the line.

Regards
Ian

Dim lRc                 As Long
Dim tm                  As TEXTMETRIC
Dim lf                  As LOGFONT
Dim bTempFontName()     As Byte
Dim nByteLimit          As Integer
Dim nLoop               As Integer

    lRc = SetGraphicsMode(UserControl.hDC, GM_ADVANCED)
    lRc = GetTextMetrics(UserControl.hDC, tm)
    With lf
        .lfHeight = tm.tmHeight            'UserControl.Font.SIZE
'tm.tmHeight
        .lfWidth = tm.tmAveCharWidth       'UserControl.Font.SIZE
'.tmMaxCharWidth
        Select Case m_nTextRotate
            Case textRotateNormal
                .lfEscapement = 0
            Case textRotate90
                .lfEscapement = 900
            Case textRotate180
                .lfEscapement = 1800
            Case textRotate270
                .lfEscapement = 2700
        End Select
        Select Case m_nCharRotate
            Case charRotateNormal
                .lfOrientation = 0
            Case charRotate90
                .lfOrientation = 900
            Case charRotate180
                .lfOrientation = 1800
            Case charRotate270
                .lfOrientation = 2700
        End Select

        If (m_fMultiLine = True) Then
            .lfOrientation = 0
            .lfEscapement = 0
        End If
        .lfWeight = m_stdFont.Weight
        .lfItalic = m_stdFont.Italic
        .lfUnderline = m_stdFont.Underline
        .lfStrikeOut = m_stdFont.Strikethrough
        .lfOutPrecision = OUT_DEFAULT_PRECIS
        .lfClipPrecision = OUT_DEFAULT_PRECIS
        .lfQuality = DEFAULT_QUALITY
        .lfPitchAndFamily = DEFAULT_PITCH Or FF_DONTCARE
        .lfCharSet = DEFAULT_CHARSET
        bTempFontName = StrConv(m_stdFont.Name & Chr$(0), vbFromUnicode)
        nByteLimit = UBound(bTempFontName)
        For nLoop = 0 To nByteLimit
            .lfFaceName(nLoop) = bTempFontName(nLoop)
        Next
    End With
    If (m_fontCaption <> 0) Then lRc = DeleteObject(m_fontCaption)
    m_fontCaption = CreateFontIndirect(lf)

    oldFont = SelectObject(hDC, m_fontCaption)
     lRc = TextOut(hDC, x, y, szTemp, Len(szTemp))
    lRc = SelectObject(hDC, oldFont)


Quote:
> I would appreciate suggestions on how to rotate Text 90 degrees, like for
a
> graph legend.

> Thanks



Sat, 08 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. printing text rotated 90 degrees

2. put text in picture and rotating it 90 degrees

3. Rotate text display 90 degrees?

4. Looking for a control that will rotate text 90 degrees

5. How to rotate Text(Labels) 90 degree ?...

6. To rotate a image 90 degrees...!

7. rotate an activeX control 90 degrees

8. how do you rotate a Picture Box 90 degrees in VB4.0

9. Using BitBlt to Rotate a bitmap 90 degrees?

10. To rotate a image 90 degrees...!

11. Looking for a Visual Basic 5 tool (same as label tool, but rotated 90 degrees - vertical)

12. rotate 90 degree barcode font

 

 
Powered by phpBB® Forum Software