📄 graphicsform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.DirectX;
using Microsoft.WindowsMobile.DirectX.Direct3D;
namespace WhiteScreen
{
public partial class GraphicsForm : Form
{
/// <summary>
/// Device we are going to use to render our graphics
/// </summary>
private Device device;
public GraphicsForm()
{
InitializeComponent();
}
public void Init()
{
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
device = new Device(
0, // device number 0
DeviceType.Default, // default configuration
this, // reference to the parent window
CreateFlags.None, // no special creation flags
presentParams); // the presentation parameters
}
protected override void OnPaintBackground(PaintEventArgs e)
{
}
protected override void OnPaint(PaintEventArgs e)
{
Render();
}
private void Render()
{
device.Clear(ClearFlags.Target, Color.White, 1.0f, 0);
device.BeginScene();
device.EndScene();
device.Present();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -