Bonjour , je cherche une astuce pour rafraichir une forme générée par la fonction intersect de GDI
Lorsque je n'utilise pas la fonction on voit bien la forme rectangulaire evoluée correctement
http://www.hiboox.com/image.php?img=892a2ec.jpg
Mais quand j'utilise la fonction intersect j'obtiens ça
http://www.hiboox.com/image.php?img=611558ef.jpg
Voici la partie du code qui sert à l'affichage
Cette fonction fabrique le cercle bleu
GraphicsPath GraphCiel = new GraphicsPath();
e.Graphics.DrawPath(PenCiel, GraphCiel);
GraphCiel.AddEllipse(RectHorizon);
GraphCiel.CloseFigure();
Region RegionCiel = new Region(GraphCiel);
Cette fonction fabrique le rectangle marron
GraphicsPath GraphTerre = new GraphicsPath();
Point[] LeSol =
{
new Point((int)(CentreHorizon.X - 150),(int)(CentreHorizon.Y)),
new Point((int)(CentreHorizon.X + 150),(int)(CentreHorizon.Y)),
new Point((int)(CentreHorizon.X + 150),(int)(CentreHorizon.Y+200)),
new Point((int)(CentreHorizon.X - 150),(int)(CentreHorizon.Y+200))
};
GraphTerre.StartFigure();
e.Graphics.DrawPath(PenInvisible , GraphTerre);
GraphTerre.AddLines(LeSol);
GraphTerre.CloseFigure();
Region RegionSol = new Region(GraphTerre);
Cette fonction sert à faire l'intersection des deux et à l'afficher
RegionSol.Intersect(GraphCiel);
g.FillRegion(BrushTerre, RegionSol);
GraphTerre.Dispose();
GraphCiel.Dispose();
J'ai encore une question : comment rajouter un trait dans la région RegionSol ?
Merci
Dès que j'ai fini je poste tout