[原创]将OLE StdFont字体结构转换到API的LOGFONT字体结构

类别:.NET开发 点击:0 评论:0 推荐:
' 将OLE StdFont字体结构转换到API的LOGFONT字体结构
   With tLF

       sFont = myfont.Name
       temp = StrConv(sFont, vbFromUnicode)
       For iChar = 1 To Len(sFont)
            .lfFaceName(iChar - 1) = temp(iChar - 1)
       Next iChar
       .lfItalic = myfont.Italic
       .lfWeight = IIf(myfont.Bold, FW_BOLD, FW_NORMAL)
       .lfWidth = fontwidth
       .lfHeight = fontheight
       .lfUnderline = fontunderline
       .lfStrikeOut = fontStrikethrough
       .lfCharSet = myfont.Charset
    End With
hFnt = CreateFontIndirect(tLF)' 转换LOGFONT结构到字体句柄

本文地址:http://com.8s8s.com/it/it44575.htm