2018-01-03 13:18:01 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Bonhomme02
|
|
|
|
|
{
|
|
|
|
|
public partial class Form1 : Form
|
|
|
|
|
{
|
|
|
|
|
private Bonhomme bonhomme;
|
2018-01-04 11:34:30 +01:00
|
|
|
|
private Peau jambe;
|
|
|
|
|
private Pied pied;
|
2018-01-03 13:18:01 +01:00
|
|
|
|
private BufferedGraphics bufferG = null;
|
|
|
|
|
private Graphics g;
|
2018-01-04 11:34:30 +01:00
|
|
|
|
|
2018-01-03 13:18:01 +01:00
|
|
|
|
public Form1()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
// Modification contre le scintillement - Creation d'une mémoire tampon graphique
|
|
|
|
|
bufferG = BufferedGraphicsManager.Current.Allocate(TV.CreateGraphics(), TV.DisplayRectangle);
|
|
|
|
|
g = bufferG.Graphics;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void timerImage_Tick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (/*this.bonhomme.Origine.X + this.bonhomme.Lhorizontal >= this.TV.Width*/1==1)
|
|
|
|
|
{
|
|
|
|
|
this.timerImage.Stop();
|
|
|
|
|
this.btnStopDeplacerCTick.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnStopDeplacerCTick_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.timerImage.Stop();
|
|
|
|
|
this.btnStopDeplacerCTick.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnEffacer_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Graphics gr = Graphics.FromHwnd(this.TV.Handle);
|
|
|
|
|
gr.FillRectangle(new SolidBrush(this.TV.BackColor), 0, 0, this.TV.Bounds.Width, this.TV.Bounds.Height);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnCreationCarrosse_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2018-01-04 11:34:30 +01:00
|
|
|
|
jambe = new Peau(this.TV, 80, 80, 50, 10, Math.PI/2);
|
|
|
|
|
pied = new Pied(this.TV, ref jambe, 25, 10, Math.PI/8);
|
|
|
|
|
jambe.Afficher(this.TV.Handle);
|
|
|
|
|
pied.Afficher(this.TV.Handle);
|
2018-01-03 13:18:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|