- 1
How I can do recursive method with keyeventargs (up,down)
SierpinskiCarpet(Graphics g, Brush brush, Single x, Single y, Single width, Single height, int Iteration)
1 Respuesta
0
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Aufgabe3
{
public class Sierpinski : Form
{
public Sierpinski()
{
Width = 600;
Height = 600;
Text = "Sierpinski-Teppich";
}
static void Main()
{
Application.Run(new Sierpinski());
}
protected override void OnPaint(PaintEventArgs e)
{
RectangleF bounds = e.Graphics.VisibleClipBounds;
Graphics g = e.Graphics;
SierpinskiTeppich(g,Brushes.Yellow,0,0,600,600,0); // Das weis ich nicht obs richtig ist...
}
private void SierpinskiTeppich(Graphics g, Brush brush, Single x, Single y, Single width, Single height, int iteration)
{
if (iteration == 0) // von hier bis...
{
g.FillRectangle(Brushes.Blue,x,y,width,height);