トップページ > 過去ログ > 記事閲覧
C#でformとDXライブラリのウインドウの連携方法
名前:log 日時: 2011/07/26 15:45

C#でプログラムを行おうとしているのですが、 DXライブラリで作成するウインドウと C#でのformとをリアルタイムで連携させたいのですが 方法が分からないためどなたか ご教授願います。

Page: 1 |

Re: C#でformとDXライブラリのウインドウの連携方法 ( No.1 )
名前:レンタッカ 日時:2011/07/26 18:21

DXライブラリからC#の描画スレッドに制御を 渡すところまで作成してみました。 using System.Runtime.InteropServices; using DxLibDLL; [DllImport("DxLib.dll")] static extern int dx_SetUserWindow(IntPtr handle); private void form_Shown(object sender, EventArgs e) { dx_SetUserWindow(this.Handle); DX.ChangeWindowMode(DX.TRUE); DX.DxLib_Init(); } private void form_FormClosed(object sender, FormClosedEventArgs e) { DX.DxLib_End(); } private void form_Paint(object sender, PaintEventArgs e) { DX.SetDrawScreen(DX.DX_SCREEN_BACK); int col = DX.GetColor(255, 0, 0); DX.DrawBox(0, 0, 800, 600, col, DX.TRUE); DX.ScreenCopy(); }

Page: 1 |