質問編集履歴

1

ソースコード、画像の削除

2019/12/20 08:41

投稿

tnet_kawahara
tnet_kawahara

スコア8

test CHANGED
File without changes
test CHANGED
@@ -17,97 +17,3 @@
17
17
  GDI+のDrawStringは常に96dpiとして文字間隔を設定しているのでしょうか?
18
18
 
19
19
  ご存知の方いらしたら教えてください。
20
-
21
-
22
-
23
- ◆画面の描画(濃い方)と印刷結果(薄い方)を重ねた図
24
-
25
- ![![イメージ説明](5f81017770e077ee9ff36a7a01dc6aa7.png)](b7e350001910a1d061515a4e5ad2aa42.png)
26
-
27
-
28
-
29
- ### 該当のソースコード
30
-
31
-
32
-
33
- ```C++
34
-
35
- Gdiplus::Graphics graphics(*pDC);
36
-
37
-
38
-
39
- //Setting
40
-
41
- graphics.SetPageUnit(Gdiplus::UnitPixel);
42
-
43
- graphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);
44
-
45
- graphics.SetTextRenderingHint(Gdiplus::TextRenderingHintAntiAlias);
46
-
47
- Gdiplus::StringFormat format = Gdiplus::StringFormat::GenericDefault();
48
-
49
-
50
-
51
- //Font
52
-
53
- LOGFONT font;
54
-
55
- memset(&font, 0, sizeof(LOGFONT));
56
-
57
- font.lfHeight = 14;
58
-
59
- font.lfWeight = 0;
60
-
61
- font.lfEscapement = 0;
62
-
63
- font.lfOrientation = 0;
64
-
65
- font.lfWeight = m_fontStyle.isBold ? FW_BOLD : FW_NORMAL;
66
-
67
- font.lfItalic = m_fontStyle.isItalic ? TRUE : FALSE;
68
-
69
- font.lfUnderline = m_fontStyle.isUnderLine ? TRUE : FALSE;
70
-
71
- font.lfStrikeOut = 0;
72
-
73
- font.lfCharSet = DEFAULT_CHARSET;
74
-
75
- font.lfOutPrecision = OUT_TT_ONLY_PRECIS;
76
-
77
- font.lfClipPrecision = CLIP_DEFAULT_PRECIS;
78
-
79
- font.lfQuality = CLEARTYPE_QUALITY;
80
-
81
- font.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
82
-
83
- Gdiplus::Font fontF(*pDC, &font);
84
-
85
-
86
-
87
- //Rect
88
-
89
- Gdiplus::RectF rectF((REAL)bounds.x,
90
-
91
- (REAL)bounds.y,
92
-
93
- (REAL)(bounds.width != 0 ? bounds.width : 0.0001),
94
-
95
- (REAL)(bounds.height != 0 ? bounds.height : 0.0001));
96
-
97
-
98
-
99
- //Draw
100
-
101
- //font.lfHeightやrectFは印刷時には高DPIに合わせてサイズを変更しています
102
-
103
- graphics.DrawString((const wchar_t*)m_text, -1, &fontF, rectF, &format, &brush);
104
-
105
- ```
106
-
107
-
108
-
109
- ### 補足情報
110
-
111
-
112
-
113
- VC++ 2012で開発