bonhomeExamJanvier/Bonhomme02/Tete.cs

83 lines
2.5 KiB
C#
Raw Normal View History

2018-01-03 13:18:01 +01:00
using System;
using System.Collections.Generic;
2018-01-05 12:19:46 +01:00
using System.Drawing;
2018-01-03 13:18:01 +01:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2018-01-05 12:19:46 +01:00
using System.Windows.Forms;
2018-01-03 13:18:01 +01:00
namespace Bonhomme02
{
2018-01-05 12:19:46 +01:00
class Tete : BaseDessin
2018-01-03 13:18:01 +01:00
{
2018-01-05 12:19:46 +01:00
public int rayon;
Peau corp;
public Tete() : base()
{
}
public Tete(PictureBox hebergeur, ref Peau corp, int rayon) : base(hebergeur)
{
this.rayon = rayon;
this.corp = corp;
}
public void Cacher(IntPtr handle)
2018-01-05 12:19:46 +01:00
{
Point posi = new Point(corp.coordonnee.X - rayon, corp.coordonnee.Y - rayon * 2);
if (base.Visible)
{
Graphics gr = Graphics.FromHwnd(handle);
if (base.Remplir)
{
gr.FillEllipse(new SolidBrush(base.Hebergeur.BackColor), posi.X , posi.Y, rayon*2, rayon*2);
2018-01-05 12:19:46 +01:00
}
gr.DrawEllipse(new Pen(base.Hebergeur.BackColor), posi.X, posi.Y, rayon*2, rayon*2);
2018-01-05 12:19:46 +01:00
}
}
public void Afficher(IntPtr handle)
2018-01-05 12:19:46 +01:00
{
if (base.Visible)
{
Graphics gr = Graphics.FromHwnd(handle);
Point posi = new Point(corp.coordonnee.X - rayon , corp.coordonnee.Y - rayon * 2);
if (base.Remplir)
{
2018-01-09 13:49:11 +01:00
gr.FillEllipse(new SolidBrush(base.Fond), posi.X, posi.Y, rayon * 2, rayon * 2);
2018-01-05 12:19:46 +01:00
}
gr.DrawEllipse(new Pen(Brushes.Black), posi.X, posi.Y, rayon * 2, rayon * 2);
}
}
2018-01-09 20:19:49 +01:00
public void Cacher(Graphics gr)
{
Point posi = new Point(corp.coordonnee.X - rayon, corp.coordonnee.Y - rayon * 2);
if (base.Visible)
{
if (base.Remplir)
{
gr.FillEllipse(new SolidBrush(base.Hebergeur.BackColor), posi.X, posi.Y, rayon * 2, rayon * 2);
}
gr.DrawEllipse(new Pen(base.Hebergeur.BackColor), posi.X, posi.Y, rayon * 2, rayon * 2);
}
}
public void Afficher(Graphics gr)
{
if (base.Visible)
{
Point posi = new Point(corp.coordonnee.X - rayon, corp.coordonnee.Y - rayon * 2);
if (base.Remplir)
{
gr.FillEllipse(new SolidBrush(base.Fond), posi.X, posi.Y, rayon * 2, rayon * 2);
}
gr.DrawEllipse(new Pen(Brushes.Black), posi.X, posi.Y, rayon * 2, rayon * 2);
}
}
2018-01-05 12:19:46 +01:00
2018-01-03 13:18:01 +01:00
}
}