字体

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    LOGFONT lf; // Windows native font structure
 
    Canvas->Brush->Style = bsClear; // Set the brush style to transparent.
    ZeroMemory(&lf, sizeof(LOGFONT));
 
    lf.lfHeight = 20;
    lf.lfEscapement = 10 * 45; // Degrees to rotate
    lf.lfOrientation = 10 * 45;
    lf.lfCharSet = DEFAULT_CHARSET;
    strcpy(lf.lfFaceName, "Tahoma");
 
    Canvas->Font->Handle = CreateFontIndirect(&lf);
    Canvas->TextOut(10, 100, "Rotated text"); // Output the rotated font.
}

 

posted on 2015-07-13 20:58  lypzxy  阅读(157)  评论(0编辑  收藏  举报