83 lines
2.5 KiB
C#
83 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Bonhomme02
|
|
{
|
|
class Tete : BaseDessin
|
|
{
|
|
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)
|
|
{
|
|
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);
|
|
}
|
|
gr.DrawEllipse(new Pen(base.Hebergeur.BackColor), posi.X, posi.Y, rayon*2, rayon*2);
|
|
}
|
|
}
|
|
public void Afficher(IntPtr handle)
|
|
{
|
|
|
|
if (base.Visible)
|
|
{
|
|
Graphics gr = Graphics.FromHwnd(handle);
|
|
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);
|
|
}
|
|
}
|
|
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);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|