1. Winform
using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;
namespace MyNamespace
{
public class MyForm : Form
{
private static readonly Pen[] pens = new[] {
Pens.Red,
Pens.Green,
Pens.Blue,
Pens.Cyan,
Pens.Yellow,
Pens.Magenta,
};
private static readonly Random random = new Random();
private const int LINE_WIDTH = 800;
private volatile bool isRendering = true;
private int frameCount = 0;
private Graphics graphics = null;
private BufferedGraphics gfx = null;
public MyForm()
{
Width = LINE_WIDTH;
Height = LINE_WIDTH;
StartPosition = FormStartPosition.CenterScreen; <
using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;
namespace MyNamespace
{
public class MyForm : Form
{
private static readonly Pen[] pens = new[] {
Pens.Red,
Pens.Green,
Pens.Blue,
Pens.Cyan,
Pens.Yellow,
Pens.Magenta,
};
private static readonly Random random = new Random();
private const int LINE_WIDTH = 800;
private volatile bool isRendering = true;
private int frameCount = 0;
private Graphics graphics = null;
private BufferedGraphics gfx = null;
public MyForm()
{
Width = LINE_WIDTH;
Height = LINE_WIDTH;
StartPosition = FormStartPosition.CenterScreen; <