如何用 TextOut 或者 DrawText 输出垂直90 的文字?用 '@宋体'字体可以不?

解决方案 »

  1.   

    CreateFont可以创建任意角度的字体,选进DC就可以了
      

  2.   

    CFont font;
    VERIFY(font.CreateFont(
       12,                        // nHeight
       0,                         // nWidth
       0,                         // nEscapement
       90,                         // nOrientation
       FW_NORMAL,                 // nWeight
       FALSE,                     // bItalic
       FALSE,                     // bUnderline
       0,                         // cStrikeOut
       ANSI_CHARSET,              // nCharSet
       OUT_DEFAULT_PRECIS,        // nOutPrecision
       CLIP_DEFAULT_PRECIS,       // nClipPrecision
       DEFAULT_QUALITY,           // nQuality
       DEFAULT_PITCH | FF_SWISS,  // nPitchAndFamily
       "Arial"));                 // lpszFacename// Do something with the font just created...
    CClientDC dc(this);  
    CFont* def_font = dc.SelectObject(&font);
    dc.TextOut(5, 5, "Hello", 5);
    dc.SelectObject(def_font);// Done with the font.  Delete the font object.
    font.DeleteObject();