Dessiner un rond plein

Résolu
cs_fcolo Messages postés 201 Date d'inscription mercredi 8 février 2006 Statut Membre Dernière intervention 20 février 2007 - 19 oct. 2006 à 14:08
cs_fcolo Messages postés 201 Date d'inscription mercredi 8 février 2006 Statut Membre Dernière intervention 20 février 2007 - 19 oct. 2006 à 14:22
Bonjour,

Je souhaiterai créer un live une icone représantant un rond plein.
J'arrive à créer un rond, mais je ne sasi pas comment remplir l'intérieur.
Je fais ca actuellement:

public Icon CreerRond(Pen myPen,
int width,
int height)
{
Bitmap bitmap =
new Bitmap(width, height);
Graphics graph = Graphics.FromImage(bitmap);
graph.DrawEllipse(myPen,0,0,width,height);
graph.Flush();

return Icon.FromHandle(
new Bitmap(bitmap).GetHicon());
}

Queqlu'un serait m'aider?

f.colo
A voir également:

2 réponses

cs_Bidou Messages postés 5487 Date d'inscription dimanche 4 août 2002 Statut Membre Dernière intervention 20 juin 2013 61
19 oct. 2006 à 14:12
Salut,
Au lieu d'utiliser DrawXXX tu utilises FillXXX, et c'est tout....

-Blog-
3
cs_fcolo Messages postés 201 Date d'inscription mercredi 8 février 2006 Statut Membre Dernière intervention 20 février 2007 2
19 oct. 2006 à 14:22
Merci beaucoup, va peut etre falloir que j'apprenne l'anglais moi ^^.

f.colo

Voila quelques icones que j'ai faites



private
Icon CreerCroix(Pen myPen2,

int
width,

int
height)
{
Bitmap bitmap =

new
Bitmap(width,height);
Graphics graph = Graphics.FromImage(bitmap);
graph.DrawLine(myPen2,

new
Point(width/2,0),

new
Point(width/2,height));
graph.DrawLine(myPen2,

new
Point(0,height/2),

new
Point(width,height/2));
graph.Flush();


return
Icon.FromHandle(

new
Bitmap(bitmap).GetHicon());
}




public
Icon CreerRond(Brush myBrush,

int
width,

int
height)
{
Bitmap bitmap =

new
Bitmap(width, height);
Graphics graph = Graphics.FromImage(bitmap);
graph.FillEllipse(myBrush,0,0,width,height);
graph.Flush();


return
Icon.FromHandle(

new
Bitmap(bitmap).GetHicon());
}




public
Icon CreerLosange(Brush myBrush,

int
width,

int
height)
{
Bitmap bitmap =

new
Bitmap(width, height);
Graphics graph = Graphics.FromImage(bitmap);
graph.FillPolygon(
myBrush,


new
Point[]{


new
Point(width/2,0),


new
Point(width,height/2),


new
Point(width/2,height),


new
Point(0,height/2)
}
);
graph.Flush();


return
Icon.FromHandle(

new
Bitmap(bitmap).GetHicon());
}
0
Rejoignez-nous