Esempio n. 1
0
 public CDessinTranche(
     CDessinEditeurPreventive dessinEditeur,
     CTranche tranche,
     EPositionDessinTranche position)
 {
     m_dessinEditeur = dessinEditeur;
     m_position      = position;
     m_tranche       = tranche;
 }
Esempio n. 2
0
        public CDessinSite(
            CDessinEditeurPreventive dessinEditeur,
            CSite site)
        {
            m_dessinEditeur = dessinEditeur;
            m_site          = site;

            //CREATION DES CELLULES
            m_dessinsCellules = new List <CDessinTrancheSite>();
            foreach (CDessinTranche col in m_dessinEditeur.DessinsTranches)
            {
                m_dessinsCellules.Add(new CDessinTrancheSite(this, col));
            }
        }
Esempio n. 3
0
        public void OnMouseMouve(Point p)
        {
            CInterventionPourEditeurPreventive inter  = GetInterventionFromPoint(p);
            CDessinEditeurPreventive           dessin = DessinSite.DessinEditeur;

            if (inter != null)
            {
                dessin.InterSurvolee   = inter;
                dessin.ListeOpSurvolee = null;
            }
            else
            {
                dessin.InterSurvolee   = null;
                dessin.ListeOpSurvolee = GetListeOperationFromPoint(p);
            }
        }
Esempio n. 4
0
        public void Draw(Graphics g, Rectangle rect)
        {
            if (m_cacheDessin != null && rect.Size == CacheDessin.Size)
            {
                g.DrawImageUnscaled(m_cacheDessin, rect.Location);
            }
            else
            {
                Rectangle rcImage = rect;
                rcImage.Offset(new Point(-rcImage.Left, -rcImage.Top));
                Image      img   = new Bitmap(rect.Size.Width, rect.Size.Height);
                Graphics   gTmp  = Graphics.FromImage(img);
                SolidBrush brush = new SolidBrush(Color.Beige);
                gTmp.FillRectangle(brush, rcImage);
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Bas, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);
                g.DrawImageUnscaled(img, rect.Location);
                m_cacheDessin = img;

                brush.Dispose();
            }
        }
Esempio n. 5
0
        public void Draw(Graphics g, Rectangle rect)
        {
            if (m_cacheDessin != null && rect.Size == CacheDessin.Size)
            {
                g.DrawImageUnscaled(m_cacheDessin, rect.Location);
                return;
            }

            m_nLastHauteur = rect.Height;

            Rectangle rcImage = rect;

            rcImage.Offset(new Point(-rcImage.Left, -rcImage.Top));

            Image    img  = new Bitmap(rcImage.Size.Width, rcImage.Size.Height);
            Graphics gTmp = Graphics.FromImage(img);

            //Si assez large on met un label ?
            SolidBrush brush = new SolidBrush(Color.Beige);

            gTmp.FillRectangle(brush, rcImage);

            SizeF sz      = gTmp.MeasureString(Site.Libelle, Police);
            float xPolice = 0;
            float yPolice = 0;

            switch (AlignementTexte)
            {
            case ContentAlignment.BottomCenter:
            case ContentAlignment.BottomLeft:
            case ContentAlignment.BottomRight:
                rcImage.Offset(0, rcImage.Height - rcImage.Height);
                break;

            case ContentAlignment.MiddleCenter:
            case ContentAlignment.MiddleLeft:
            case ContentAlignment.MiddleRight:
                xPolice  = (rcImage.Width / 2) - sz.Width / 2;
                yPolice  = (rcImage.Height / 2) - sz.Height / 2;
                xPolice += rcImage.Location.X;
                yPolice += rcImage.Location.Y;
                break;
            }
            switch (AlignementTexte)
            {
            case ContentAlignment.BottomCenter:
            case ContentAlignment.MiddleCenter:
            case ContentAlignment.TopCenter:
                rcImage.Offset(rcImage.Width / 2 - rcImage.Width / 2, 0);
                break;

            case ContentAlignment.BottomRight:
            case ContentAlignment.MiddleRight:
            case ContentAlignment.TopRight:
                rcImage.Offset(rcImage.Width - rcImage.Width, 0);
                break;
            }
            SolidBrush   brush2      = new SolidBrush(CouleurTexte);
            StringFormat formatTexte = new StringFormat();

            formatTexte.Alignment     = StringAlignment.Center;
            formatTexte.LineAlignment = StringAlignment.Center;
            gTmp.DrawString(Site.Libelle, Police, brush2, rcImage, formatTexte);

            CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Bas, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);

            g.DrawImageUnscaled(img, rect.Location);
            m_cacheDessin = img;

            brush.Dispose();
            brush2.Dispose();
        }
Esempio n. 6
0
 public CDessinAngle(CDessinEditeurPreventive dessinEditeur)
 {
     m_dessinEditeur = dessinEditeur;
 }
Esempio n. 7
0
        public void Draw(Graphics g, Rectangle rect)
        {
            if (m_cacheDessin == null && !m_bRefreshInters)
            {
                Initialiser();
            }
            else if (rect.Size == CacheDessin.Size && !m_bRefreshInters)
            {
                g.DrawImageUnscaled(CacheDessin, rect.Location);
                return;
            }


            Rectangle rcImage = rect;

            rcImage.Offset(new Point(-rcImage.Left, -rcImage.Top));

            Image    img  = new Bitmap(rect.Size.Width, rect.Size.Height);
            Graphics gTmp = Graphics.FromImage(img);


            SolidBrush brushAzure      = new SolidBrush(Color.Azure);
            SolidBrush brushGray       = new SolidBrush(Color.Gray);
            SolidBrush brushRoyaleBlue = new SolidBrush(Color.RoyalBlue);
            Pen        crayonBleu      = new Pen(brushRoyaleBlue);

            crayonBleu.Width = 2;

            //Pour toutes les lignes
            for (int nL = 1; nL <= NombreLigne; nL++)
            {
                //Recupération du rectangle
                int       posY       = nL == 1 ? 0 : (nL - 1) * (rcImage.Height / NombreLigne);
                Rectangle rectLigneN = new Rectangle(0, posY, rcImage.Width, rcImage.Height / NombreLigne);

                //BACKGROUND
                bool bConcerne = DessinSite.MappageNumeroLigneContrat[nL].AssocieAuSite(DessinSite.Site);
                if (bConcerne)
                {
                    gTmp.FillRectangle(brushAzure, rectLigneN);
                }
                else
                {
                    gTmp.FillRectangle(brushGray, rectLigneN);
                }
                if (nL == 1 && DessinSite.EnEdition && bConcerne)
                {
                    List <CTranche> tranches = DessinSite.DecoupageObjectifElementEnEdition.GetTranchesConcernees(DateDebut, DateFin);
                    foreach (CTranche t in tranches)
                    {
                        SolidBrush brush = new SolidBrush(DessinSite.GetColorOfTranche(t));

                        DateTime dtStartDecoup = t.DateDebut < DateDebut ? DateDebut : t.DateDebut;
                        DateTime dtEndDecoup   = t.DateFin > DateFin ? DateFin : t.DateFin;
                        decimal  fWithTranche  = ((
                                                      ((decimal)dtEndDecoup.Ticks - (decimal)dtStartDecoup.Ticks)
                                                      * (decimal)rectLigneN.Width) /
                                                  ((decimal)DateFin.Ticks - (decimal)DateDebut.Ticks));
                        int       nWithTranche = Convert.ToInt32(fWithTranche) + 1;
                        int       posX         = GetX(dtStartDecoup, rectLigneN.Width);
                        Rectangle rTranche     = new Rectangle(posX, 0, nWithTranche, rectLigneN.Height);
                        gTmp.FillRectangle(brush, rTranche);
                        brush.Dispose();
                    }
                }

                //DESSIN DES INTERS
                List <CDessinListeOperations> dessinsInters = GetDessinsInterOfLigne(nL);
                foreach (CDessinListeOperations dessin in dessinsInters)
                {
                    dessin.Draw(gTmp, rectLigneN);
                }



                if (nL > 1)
                {
                    CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Haut, System.Drawing.Drawing2D.DashStyle.Dot, Color.Wheat, 1, rectLigneN, gTmp);
                }
            }


            //LIGNES OBJECTIF
            if (DessinSite.ContratListesOperationsEnCour != null)
            {
                CDecoupage      decoupEle      = DessinSite.DecoupageObjectifElementEnEdition;
                List <DateTime> datesDecoupage = decoupEle.GetDatesConcernees(DateDebut, DateFin);
                foreach (DateTime dt in datesDecoupage)
                {
                    //Dessiner la ligne
                    //System.Drawing.Drawing2D.DashStyle styleLigne = System.Drawing.Drawing2D.DashStyle.Solid;
                    //if (nCptDecoup == 0 || nCptDecoup == datesDecoupage.Count - 1)
                    //    styleLigne = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                    //crayonBleu.DashStyle = styleLigne;
                    int posXLigne = GetX(dt, rcImage.Width);
                    if (posXLigne == rcImage.Width)
                    {
                        posXLigne--;
                    }
                    if (posXLigne == 0)
                    {
                        posXLigne++;
                    }
                    gTmp.DrawLine(crayonBleu, new Point(posXLigne, 0), new Point(posXLigne, rcImage.Height));
                }
            }


            //BORDS DROIT ET GAUCHE
            switch (DessinTranche.PositionTranche)
            {
            case EPositionDessinTranche.Debut:
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Gauche, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);
                break;

            case EPositionDessinTranche.Fin:
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Droite, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);
                goto case EPositionDessinTranche.Intermediaire;

            case EPositionDessinTranche.Intermediaire:
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Gauche, System.Drawing.Drawing2D.DashStyle.Dash, Color.Black, 1, rcImage, gTmp);
                break;

            case EPositionDessinTranche.Unique:
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Gauche, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Droite, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);
                break;
            }

            CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Bas, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);

            g.DrawImageUnscaled(img, rect.Location);
            m_cacheDessin = img;

            m_bRefreshInters = false;

            brushAzure.Dispose();
            brushGray.Dispose();
            brushRoyaleBlue.Dispose();
            crayonBleu.Dispose();
        }
Esempio n. 8
0
        public void Draw(Graphics g, Rectangle rect)
        {
            //Cache valide
            if (m_cacheDessin != null && rect.Size == CacheDessin.Size)
            {
                g.DrawImageUnscaled(m_cacheDessin, rect.Location);
            }
            else
            {
                Rectangle rcImage = rect;
                rcImage.Offset(new Point(-rcImage.Left, -rcImage.Top));

                Image    img  = new Bitmap(rect.Size.Width, rect.Size.Height);
                Graphics gTmp = Graphics.FromImage(img);

                SolidBrush brush = new SolidBrush(Color.Beige);
                gTmp.FillRectangle(brush, rcImage);
                //Calendar calendrier = CultureInfo.InvariantCulture.Calendar;
                int nWeekD = CUtilDate.GetWeekNum(DateDebut);
                //int nWeekD = calendrier.GetWeekOfYear(DateDebut, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
                string strWeekD = nWeekD.ToString();
                if (nWeekD < 10)
                {
                    strWeekD = "0" + strWeekD;
                }
                string strMoisD = DateDebut.Month.ToString();
                if (DateDebut.Month < 10)
                {
                    strMoisD = "0" + strMoisD;
                }
                string strJourD = DateDebut.Day.ToString();
                if (DateDebut.Day < 10)
                {
                    strJourD = "0" + strJourD;
                }
                string strAnneeD = DateDebut.Year.ToString();

                int nWeekF = CUtilDate.GetWeekNum(DateFin);
                //int nWeekF = calendrier.GetWeekOfYear(DateFin, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
                string strWeekF = nWeekF.ToString();
                if (nWeekF < 10)
                {
                    strWeekF = "0" + strWeekF;
                }
                string strMoisF = DateFin.Month.ToString();
                if (DateFin.Month < 10)
                {
                    strMoisF = "0" + strMoisF;
                }
                string strJourF = DateFin.Day.ToString();
                if (DateFin.Day < 10)
                {
                    strJourF = "0" + strJourF;
                }
                string strAnneeF = DateFin.Year.ToString();

                //string strWeekF2 = calendrier.GetWeekOfYear(DateFin, CalendarWeekRule.FirstDay, DayOfWeek.Monday).ToString();

                string strDateD = "";
                string strDateF = "";

                switch (FormatDate)
                {
                default:
                case EFormatDate.JourMoisAnnee:
                    strDateD = strJourD + "/" + strMoisD + "/" + strAnneeD;
                    strDateF = strJourF + "/" + strMoisF + "/" + strAnneeF;
                    break;

                case EFormatDate.JourMois:
                    strDateD = strJourD + "/" + strMoisD;
                    strDateF = strJourF + "/" + strMoisF;
                    break;

                case EFormatDate.MoisAnnee:
                    strDateD = strMoisD + "/" + strAnneeD;
                    strDateF = strMoisF + "/" + strAnneeF;
                    break;

                case EFormatDate.Jour:
                    strDateD = strJourD;
                    strDateF = strJourF;
                    break;

                case EFormatDate.Mois:
                    strDateD = strMoisD;
                    strDateF = strMoisF;
                    break;

                case EFormatDate.Annee:
                    strDateD = strAnneeD;
                    strDateF = strAnneeF;
                    break;

                case EFormatDate.Semaine:
                    strDateD = strWeekD;
                    strDateF = strWeekF;
                    break;
                }


                SizeF sDateD = gTmp.MeasureString(strDateD, Police);
                SizeF sDateF = gTmp.MeasureString(strDateF, Police);

                int       nHDateD      = 0;
                int       nYCadreDateD = 0;
                int       nWDateD      = 0;
                int       nXCadreDateD = 0;
                Rectangle rDateD       = new Rectangle();

                int       nHDateF      = 0;
                int       nYCadreDateF = 0;
                int       nWDateF      = 0;
                int       nXCadreDateF = 0;
                Rectangle rDateF       = new Rectangle();

                Pen   crayonRouge        = new Pen(Brushes.Red);
                Brush brushBlack         = new SolidBrush(Color.Black);
                Brush brushPaleGoldenrod = new SolidBrush(Color.PaleGoldenrod);
                switch (PositionTranche)
                {
                case EPositionDessinTranche.Fin:
                    CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Droite, System.Drawing.Drawing2D.DashStyle.Dash, Color.Black, 1, rcImage, gTmp);
                    Image    imgEtqFin = new Bitmap(((int)sDateF.Width + 5), ((int)sDateF.Height + 5));
                    Graphics gEtqFin   = Graphics.FromImage(imgEtqFin);
                    rDateF = new Rectangle(0, 0, (int)sDateF.Width + 4, (int)sDateF.Height + 4);
                    gEtqFin.FillRectangle(brushPaleGoldenrod, rDateF);
                    gEtqFin.DrawRectangle(crayonRouge, rDateF);
                    gEtqFin.DrawString(strDateF, Police, brushBlack, 2, 2);
                    imgEtqFin.RotateFlip(RotateFlipType.Rotate270FlipNone);
                    gTmp.DrawImageUnscaled(imgEtqFin, new Point(rcImage.Width - 1 - imgEtqFin.Width, (rcImage.Height / 2) - imgEtqFin.Height / 2));
                    if (PositionTranche != EPositionDessinTranche.Unique)
                    {
                        goto case EPositionDessinTranche.Intermediaire;
                    }
                    else
                    {
                        CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Gauche, System.Drawing.Drawing2D.DashStyle.Dash, Color.Black, 1, rcImage, gTmp);
                        break;
                    }

                case EPositionDessinTranche.Debut:
                    Image    imgEtqDebut = new Bitmap(((int)sDateD.Width + 5), ((int)sDateD.Height + 5));
                    Graphics gEtqDebut   = Graphics.FromImage(imgEtqDebut);
                    rDateD = new Rectangle(0, 0, (int)sDateD.Width + 4, (int)sDateD.Height + 4);
                    gEtqDebut.FillRectangle(brushPaleGoldenrod, rDateD);
                    gEtqDebut.DrawRectangle(crayonRouge, rDateD);
                    gEtqDebut.DrawString(strDateD, Police, brushBlack, 2, 2);
                    imgEtqDebut.RotateFlip(RotateFlipType.Rotate270FlipNone);
                    gTmp.DrawImageUnscaled(imgEtqDebut, new Point(1, (rcImage.Height / 2) - imgEtqDebut.Height / 2));

                    if (PositionTranche != EPositionDessinTranche.Unique)
                    {
                        goto case EPositionDessinTranche.Intermediaire;
                    }
                    else
                    {
                        goto case EPositionDessinTranche.Fin;
                    }

                case EPositionDessinTranche.Intermediaire:

                    CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Gauche, System.Drawing.Drawing2D.DashStyle.Dash, Color.Black, 1, rcImage, gTmp);

                    #region LABEL DROIT
                    if (PositionTranche != EPositionDessinTranche.Fin)
                    {
                        nHDateF      = (int)sDateF.Height;
                        nYCadreDateF = ((rcImage.Height / 2) - (nHDateF / 2) - 2);

                        nWDateF      = (int)sDateF.Width;
                        nXCadreDateF = (rcImage.Width - (nWDateF / 2) - 2);
                        if (nWDateF % 2 != 0)
                        {
                            nXCadreDateF--;
                        }

                        rDateF = new Rectangle(nXCadreDateF, nYCadreDateF, ((int)sDateF.Width + 4), ((int)sDateF.Height + 4));
                        gTmp.FillRectangle(brushPaleGoldenrod, rDateF);
                        gTmp.DrawRectangle(crayonRouge, rDateF);
                        int posXFont = nXCadreDateF + 3;
                        int posYFont = nYCadreDateF + 2;
                        if (FormatDate == EFormatDate.JourMoisAnnee ||
                            FormatDate == EFormatDate.Mois)
                        {
                            posXFont += 2;
                        }
                        gTmp.DrawString(strDateF, Police, brushBlack, posXFont, posYFont);
                    }
                    #endregion

                    #region LABEL GAUCHE
                    if (PositionTranche != EPositionDessinTranche.Debut)
                    {
                        nHDateD      = (int)sDateD.Height;
                        nYCadreDateD = ((rcImage.Height / 2) - (nHDateD / 2) - 2);
                        nWDateD      = (int)sDateD.Width;
                        nXCadreDateD = (-(nWDateD / 2) - 2);
                        if (nWDateD % 2 != 0)
                        {
                            nXCadreDateD++;
                        }

                        int posYFont = nYCadreDateD + 2;
                        int posXFont = nXCadreDateD + 3;
                        if (FormatDate == EFormatDate.Semaine)
                        {
                            posXFont--;
                        }
                        rDateD = new Rectangle(nXCadreDateD, nYCadreDateD, (int)sDateD.Width + 4, (int)sDateD.Height + 4);
                        gTmp.FillRectangle(brushPaleGoldenrod, rDateD);
                        gTmp.DrawRectangle(crayonRouge, rDateD);
                        gTmp.DrawString(strDateD, Police, brushBlack, posXFont, posYFont);
                    }

                    #endregion

                    break;

                case EPositionDessinTranche.Unique:
                    goto case EPositionDessinTranche.Debut;

                default:
                    break;
                }

                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Bas, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, 1, rcImage, gTmp);

                //Sauvegarde du cache
                g.DrawImageUnscaled(img, rect.Location);
                m_cacheDessin = img;

                brush.Dispose();
                crayonRouge.Dispose();
                brushBlack.Dispose();
                brushPaleGoldenrod.Dispose();
            }
        }
Esempio n. 9
0
        //private bool m_bSurvole = false;
        public void Draw(Graphics g, Rectangle rect)
        {
            //Cache valide
            if (m_cacheDessin != null && rect.Size == CacheDessin.Size)
            {
                g.DrawImageUnscaled(m_cacheDessin, rect.Location);
            }
            else
            {
                Rectangle rcImage = rect;
                rcImage.Offset(new Point(-rcImage.Left, -rcImage.Top));

                Image    img  = new Bitmap(rect.Size.Width, rect.Size.Height);
                Graphics gTmp = Graphics.FromImage(img);

                //Hauteur et largeur du rectangle de l'inter
                int nLargeur = (int)(((DateFin.Ticks - DateDebut.Ticks) * rcImage.Width) / (DessinTrancheSite.DateFin.Ticks - DessinTrancheSite.DateDebut.Ticks));
                int nHauteur = rcImage.Height;

                //Position du rectangle de l'inter sur X
                double fEch  = ((double)DessinTrancheSite.DateFin.Ticks - (double)DessinTrancheSite.DateDebut.Ticks) / rcImage.Width;
                int    nPosX = (int)((((double)DateDebut.Ticks - (double)DessinTrancheSite.DateDebut.Ticks)) / fEch);

                Rectangle rectInter = new Rectangle(nPosX, 2, nLargeur, nHauteur - 4);

                CDessinEditeurPreventive dessinEditeur = DessinTrancheSite.DessinSite.DessinEditeur;
                bool  bSurvole      = dessinEditeur.InterSurvolee == Intervention;
                bool  bSelected     = dessinEditeur.IntersSelectionnees.Contains(Intervention);
                int   nLargeurCadre = dessinEditeur.IntersSelectionnees.Contains(Intervention)? 2 : 1;
                Color c             = dessinEditeur.InterSurvolee == Intervention && dessinEditeur.MettreEnEvidanceLelementSurvole ? Color.Red : Couleur;
                if (dessinEditeur.IntersSelectionnees.Contains(Intervention))
                {
                    c = Color.FromArgb(125, c);
                }
                SolidBrush brush = new SolidBrush(c);
                gTmp.FillRectangle(brush, rectInter);
                Rectangle rectBordure = new Rectangle(rectInter.X, rectInter.Y, rectInter.Width, rectInter.Height);
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Haut, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, nLargeurCadre, rectBordure, gTmp);
                CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Bas, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, nLargeurCadre, rectBordure, gTmp);
                if (DateDebut >= DessinTrancheSite.DateDebut)
                {
                    CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Gauche, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, nLargeurCadre, rectBordure, gTmp);
                }
                if (DateFin <= DessinTrancheSite.DateFin)
                {
                    CDessinEditeurPreventive.DessinerLigne(ECoteRectangle.Droite, System.Drawing.Drawing2D.DashStyle.Solid, Color.Black, nLargeurCadre, rectBordure, gTmp);
                }

                //TITRE LISTE OP A REDEFINIR
                //SizeF sz = gTmp.MeasureString(Intervention.Label, Police);
                //if (sz.Width <= nLargeur && sz.Height <= nHauteur)
                //{
                //    Brush br = new SolidBrush(CouleurTexte);


                //    float nPosXLabel = (rectInter.Width / 2) - (sz.Width / 2);
                //    float nPosYLabel = (rectInter.Height / 2) - (sz.Height / 2);

                //    gTmp.DrawString(Intervention.Label, Police, br, nPosXLabel,nPosYLabel);
                //    br.Dispose();
                //}

                int nPosY = rect.Location.Y;

                g.DrawImageUnscaled(img, new Point(0, nPosY));
                m_cacheDessin = img;
                m_rect        = new Rectangle(nPosX + rcImage.Left, nPosY, nLargeur, nHauteur);

                brush.Dispose();
            }
        }