前田稔(Maeda Minoru)の超初心者のプログラム入門
![]()
![]()
/*********************************************/
/*★ Direct Draw で Form を表示    前田 稔 ★*/
/*********************************************/
using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.DirectDraw;
namespace DXDraw
{
    public class DXDraw : System.Windows.Forms.Form
    {
        private Device draw = null;         // DrawDevice object.
        public DXDraw()
        {
            this.Text = "Dirext Draw";
            this.Resize += new System.EventHandler(this.DXDraw_SizeChanged);
            this.SizeChanged += new System.EventHandler(this.DXDraw_SizeChanged);
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.DXDraw_Paint);
            draw = new Device();
            draw.SetCooperativeLevel(this, CooperativeLevelFlags.Normal);
        }
        //☆ Main() メソッド
        static void Main() 
        {
            using(DXDraw mf = new DXDraw())
            {   Application.Run(mf);
            }
        }
        private void DXDraw_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Draw();
        }
        private void DXDraw_SizeChanged(object sender, System.EventArgs e)
        {
            Draw();
        }
        private void Draw()
        {
        }
    }
}
 | 
| Microsoft.DirectX | 
| Microsoft.DirectX.DirectDraw | 
| System | 
| System.Drawing | 
| System.Windows.Forms | 


| BadImageFormatException はハンドルされませんでした。 | 
![]()
    static void Main() 
    {
        using(DXDraw mf = new DXDraw())
        {   Application.Run(mf);
        }
    }
     | 
    private Device draw = null;         // DrawDevice object.
     | 
    public DXDraw()
    {
        this.Text = "Dirext Draw";
        this.Resize += new System.EventHandler(this.DXDraw_SizeChanged);
        this.SizeChanged += new System.EventHandler(this.DXDraw_SizeChanged);
        this.Paint += new System.Windows.Forms.PaintEventHandler(this.DXDraw_Paint);
        draw = new Device();
        draw.SetCooperativeLevel(this, CooperativeLevelFlags.Normal);
    }
     | 
| ファイル(フォルダー) | 説明 | 
|---|---|
| DRForm.csproj | プロジェクトファイル | 
| DRForm.cs | ソースプログラムファイル | 
![]()
| BadImageFormatException はハンドルされませんでした。 | 

![]()