Skip to content

Commit 76ab802

Browse files
committed
test commit
1 parent 538290e commit 76ab802

12 files changed

+193
-99
lines changed

curve_editor/ce_bitmap_canvas.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//----------------------------------------------------------------------------------
2+
// Curve Editor
3+
// ソースファイル(ビットマップキャンバス)
4+
// Visual C++ 2022
5+
//----------------------------------------------------------------------------------
6+
7+
#include "ce_header.hpp"
8+
9+
10+
11+
//---------------------------------------------------------------------
12+
// 初期化
13+
//---------------------------------------------------------------------
14+
void ce::Bitmap_Canvas::init(HWND hw)
15+
{
16+
hwnd = hw;
17+
HDC hdc = GetDC(hw);
18+
hdc_memory = CreateCompatibleDC(hdc);
19+
bitmap = CreateCompatibleBitmap(hdc, CE_MAX_W, CE_MAX_H);
20+
SelectObject(hdc_memory, bitmap);
21+
ReleaseDC(hw, hdc);
22+
}
23+
24+
25+
26+
//---------------------------------------------------------------------
27+
// 終了
28+
//---------------------------------------------------------------------
29+
void ce::Bitmap_Canvas::exit()
30+
{
31+
DeleteDC(hdc_memory);
32+
DeleteObject(bitmap);
33+
}
34+
35+
36+
37+
//---------------------------------------------------------------------
38+
// ビットマップをバッファから画面に転送
39+
//---------------------------------------------------------------------
40+
void ce::Bitmap_Canvas::transfer(LPRECT rect)
41+
{
42+
PAINTSTRUCT ps;
43+
HDC hdc = BeginPaint(hwnd, &ps);
44+
BitBlt(hdc, 0, 0, rect->right, rect->bottom, hdc_memory, 0, 0, SRCCOPY);
45+
EndPaint(hwnd, &ps);
46+
DeleteDC(hdc);
47+
}

curve_editor/ce_curve_value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//----------------------------------------------------------------------------------
22
// Curve Editor
33
// ソースファイル (Valueモードのカーブの関数)
4-
// VC++ 2022
4+
// Visual C++ 2022
55
//----------------------------------------------------------------------------------
66

77
#include "ce_header.hpp"

curve_editor/ce_dlgproc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//----------------------------------------------------------------------------------
22
// Curve Editor
3-
// ソースファイル (ダイアログのプロシージャ)
4-
// VC++ 2022
3+
// ソースファイル (ダイアログプロシージャ)
4+
// Visual C++ 2022
55
//----------------------------------------------------------------------------------
66

77
#include "ce_header.hpp"

curve_editor/ce_func.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//----------------------------------------------------------------------------------
22
// Curve Editor
3-
// ソースファイル (関数)
4-
// (Visual C++ 2022)
3+
// ソースファイル (その他の関数)
4+
// Visual C++ 2022
55
//----------------------------------------------------------------------------------
66

77
#include "ce_header.hpp"

curve_editor/ce_func_graphics.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,42 @@ void d2d_draw_bezier(ID2D1SolidColorBrush* pBrush,
144144
//---------------------------------------------------------------------
145145
void d2d_draw_handle(ID2D1SolidColorBrush* pBrush, ce::Double_Point st, ce::Double_Point ed)
146146
{
147-
ce::Double_Point st_new = subtract_length(ed, st, CE_SUBTRACT_LENGTH);
147+
ce::Double_Point st_new = subtract_length(ed, st, CE_SUBTRACT_LENGTH_2);
148148
ce::Double_Point ed_new = subtract_length(st, ed, CE_SUBTRACT_LENGTH);
149+
150+
ID2D1StrokeStyle* pStyle = NULL;
151+
152+
g_d2d1_factory->CreateStrokeStyle(
153+
D2D1::StrokeStyleProperties(
154+
D2D1_CAP_STYLE_ROUND,
155+
D2D1_CAP_STYLE_ROUND,
156+
D2D1_CAP_STYLE_ROUND,
157+
D2D1_LINE_JOIN_MITER,
158+
10.0f,
159+
D2D1_DASH_STYLE_SOLID,
160+
0.0f),
161+
NULL, NULL,
162+
&pStyle
163+
);
164+
149165
g_render_target->DrawLine(
150166
D2D1::Point2F(st_new.x, st_new.y),
151167
D2D1::Point2F(ed_new.x, ed_new.y),
152168
pBrush, CE_HANDLE_TH
153169
);
170+
154171
g_render_target->DrawEllipse(
155172
D2D1::Ellipse(
156173
D2D1::Point2F(ed.x, ed.y),
157174
CE_HANDLE_SIZE, CE_HANDLE_SIZE),
158175
pBrush, CE_HANDLE_SIRCLE_LINE
159176
);
160-
g_render_target->DrawEllipse(
177+
178+
g_render_target->FillEllipse(
161179
D2D1::Ellipse(
162180
D2D1::Point2F(st.x, st.y),
163181
CE_POINT_SIZE, CE_POINT_SIZE),
164-
pBrush, CE_POINT_SIZE * 1.7
182+
pBrush
165183
);
166184
}
167185

@@ -175,6 +193,7 @@ void draw_main(HWND hwnd, HDC hdc_mem, LPRECT rect_wnd, LPRECT rect_sepr)
175193
HDC hdc;
176194
static ID2D1SolidColorBrush* pBrush = NULL;
177195
ID2D1StrokeStyle* pStyle = NULL;
196+
178197
g_d2d1_factory->CreateStrokeStyle(
179198
D2D1::StrokeStyleProperties(
180199
D2D1_CAP_STYLE_ROUND,

curve_editor/ce_header.hpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
//----------------------------------------------------------------------------------
22
// Curve Editor
33
// ヘッダファイル
4-
// (Visual C++ 2022)
4+
// Visual C++ 2022
55
//----------------------------------------------------------------------------------
66

77
#pragma once
88

9+
10+
11+
//----------------------------------------------------------------------------------
12+
// include
13+
//----------------------------------------------------------------------------------
914
#include <windows.h>
1015
#include <windowsx.h>
1116
#include <wininet.h>
@@ -17,6 +22,8 @@
1722
#include "ce_macro.hpp"
1823
#include "resource.h"
1924

25+
#pragma comment(lib, "d2d1.lib")
26+
2027

2128

2229
//----------------------------------------------------------------------------------
@@ -255,6 +262,19 @@ namespace ce {
255262
HMENU menu //メニューハンドルまたは子ウィンドウ ID
256263
);
257264
};
265+
266+
267+
class Bitmap_Canvas {
268+
private:
269+
HBITMAP bitmap;
270+
HWND hwnd;
271+
public:
272+
HDC hdc_memory;
273+
274+
void init(HWND hw);
275+
void exit();
276+
void transfer(LPRECT rect);
277+
};
258278
}
259279

260280

0 commit comments

Comments
 (0)