回答編集履歴

2

リージョン作成に使う構造体の定義を忘れていた。

2019/07/10 11:33

投稿

katsuko
katsuko

スコア3475

test CHANGED
@@ -77,6 +77,18 @@
77
77
 
78
78
 
79
79
  ```cpp
80
+
81
+ // リージョン作成に使う構造体
82
+
83
+ typedef struct RegionData {
84
+
85
+ RGNDATAHEADER rdh;
86
+
87
+ RECT rect[1];
88
+
89
+ } RegionData;
90
+
91
+
80
92
 
81
93
  // こちらは、一応FillRgnを呼んで描画して確認してみた。
82
94
 

1

ソースコードのコメントを追加

2019/07/10 11:33

投稿

katsuko
katsuko

スコア3475

test CHANGED
@@ -12,9 +12,13 @@
12
12
 
13
13
  {
14
14
 
15
+ // 楕円のサイズ
16
+
15
17
  int width = rect.right - rect.left;
16
18
 
17
19
  int height = rect.bottom - rect.top;
20
+
21
+ // 楕円の中心座標
18
22
 
19
23
  int cx = rect.left + width / 2;
20
24
 
@@ -22,11 +26,15 @@
22
26
 
23
27
 
24
28
 
29
+ // 中心座標→点のベクトル
30
+
25
31
  int dx = pt.x - cx;
26
32
 
27
33
  int dy = pt.y - cy;
28
34
 
29
35
 
36
+
37
+ // ベクトルを逆回転させる。
30
38
 
31
39
  double x = dx * std::cos(-rad) - dy * std::sin(-rad);
32
40