掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
VB.NETでGetGlyphOutlineを使用するには (ID:146039)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
TrueTypeFontをセットしてやってみたのですが、 結果は変わらず、GetGlyphOutlineの戻り値は-1、 GetLastErrorの戻り値は1003でした。 以下、コードです。 Dim gm As GLYPHMETRICS 'フォント作成 Dim fontSize As Integer = 12 Dim lf As [Static].LOGFONT lf.lfHeight = fontSize lf.lfWeight = FW_NORMAL lf.lfCharSet = ANSI_CHARSET lf.lfOutPrecision = OUT_DEFAULT_PRECIS lf.lfClipPrecision = CLIP_DEFAULT_PRECIS lf.lfQuality = DEFAULT_QUALITY lf.lfPitchAndFamily = FF_SWISS + DEFAULT_PITCH lf.lfFaceName = "Arial" Dim hFont As Integer = CreateFontIndirect(lf) 'DC取得 Dim hDC As Integer = GetDC(Nothing) 'プライマリモニタのDC取得 Dim oldFont As Integer = SelectObject(hDC, hFont) Dim mat As MAT2 With mat .eM11.Value = 1 '-1にすると左右反転 .eM12.Value = 0 .eM21.Value = 0 .eM22.Value = 1 '-1にすると上下反転 End With 'コード取得 Dim uicharacter As Integer = Asc("a") 'データ格納に必要なサイズを計算 dim dsize as Integer = GetGlyphOutline(hDC, uicharacter _ , GGO_GRAY4_BITMAP, gm, 0, Nothing, mat) If dsize = -1 Then Debug.Print("Error=" + GetLastError().ToString) SelectObject(hDC, oldFont) DeleteObject(hFont) ReleaseDC(Nothing, hDC) DeleteObject(hDC) hdc = Nothing Return End If
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.