/********************************************************************/
        /*                      GRAPHICSSTACK     -KEEP                     */
        /********************************************************************/
        /// <summary>
        /// Adds an iconic object to the graphics stack similar to the way
        /// it is defined for the HDevelop graphics stack.
        /// </summary>
        /// <param name="obj">Iconic object</param>
        public void addIconicVarKeepSettings(HObject obj)
        {
            HObjectEntry entry;

            if (obj == null)
            {
                return;
            }

            if ((obj is HImage) && (obj != null))
            {
                double r, c;
                int    h, w, area;
                string s;

                area = ((HImage)obj).GetDomain().AreaCenter(out r, out c);
                ((HImage)obj).GetImagePointer1(out s, out w, out h);

                if (HObjList.Count == 0)
                {
                    heightImagePart = h;
                    widthImagePart  = w;
                    //adaptSize = true;

                    zoomWndFactor = (double)widthDisplayedImage / viewPort.Width;

                    resetImagePart(widthImagePart, heightImagePart);
                }

                if (area == (w * h))
                {
                    clearList();

                    if ((h != heightImagePart) || (w != widthImagePart))
                    {
                        heightImagePart = h;
                        widthImagePart  = w;

                        if ((widthDisplayedImage != w) || (heightDisplayedImage != h))
                        {
                            resetImagePart(w, h);
                        }

                        zoomWndFactor = (double)widthDisplayedImage / viewPort.Width;
                    }
                }//if
                widthDisplayedImage  = w;
                heightDisplayedImage = h;
            }//if
            entry = new HObjectEntry(obj, mGC.copyContextList());


            HObjList.Add(entry);

            if (HObjList.Count > MAXNUMOBJLIST)
            {
                HObjList.RemoveAt(1);
            }
        }
        /********************************************************************/
        /*                      GRAPHICSSTACK                               */
        /********************************************************************/
        /// <summary>
        /// Adds an iconic object to the graphics stack similar to the way
        /// it is defined for the HDevelop graphics stack.
        /// </summary>
        /// <param name="obj">Iconic object</param>
        public void addIconicVar(HObject obj)
        {
            HObjectEntry entry;

            if (obj == null)
            {
                return;
            }

            if (obj is HImage)
            {
                double r, c;
                int    h, w, area;
                string s;

                area = ((HImage)obj).GetDomain().AreaCenter(out r, out c);
                ((HImage)obj).GetImagePointer1(out s, out w, out h);

                if (area == (w * h))
                {
                    clearList();
                    // MODIFIED
                    if ((h != heightImagePart) || (w != widthImagePart))
                    {
                        heightImagePart = h;
                        widthImagePart  = w;
                        resetImagePart(widthImagePart, heightImagePart);
                    }
                } //if
            }     //if

            entry = new HObjectEntry(obj, mGC.copyContextList());

            HObjList.Add(entry);

            if (HObjList.Count > MAXNUMOBJLIST)
            {
                HObjList.RemoveAt(1);
            }
        }
        /********************************************************************/
        /*                      GRAPHICSSTACK     -KEEP                     */
        /********************************************************************/
        /// <summary>
        /// Adds an iconic object to the graphics stack similar to the way
        /// it is defined for the HDevelop graphics stack.
        /// </summary>
        /// <param name="obj">Iconic object</param>
        public void addIconicVarKeepSettings(HObject obj)
        {
            HObjectEntry entry;

              if (obj == null)
            return;

              if ((obj is HImage) && (obj != null))
              {
            double r, c;
            int h, w, area;
            string s;

            area = ((HImage)obj).GetDomain().AreaCenter(out r, out c);
            ((HImage)obj).GetImagePointer1(out s, out w, out h);

            if (HObjList.Count == 0)
            {
              heightImagePart = h;
              widthImagePart = w;
              //adaptSize = true;

              zoomWndFactor = (double)widthDisplayedImage / viewPort.Width;

              resetImagePart(widthImagePart, heightImagePart);
            }

            if (area == (w * h))
            {
              clearList();

              if ((h != heightImagePart) || (w != widthImagePart))
              {
                heightImagePart = h;
                widthImagePart  = w;

                if ((widthDisplayedImage != w) || (heightDisplayedImage != h))
                  resetImagePart(w, h);

                zoomWndFactor = (double)widthDisplayedImage / viewPort.Width;
              }
            }//if
            widthDisplayedImage  = w;
            heightDisplayedImage = h;
              }//if
              entry = new HObjectEntry(obj, mGC.copyContextList());

              HObjList.Add(entry);

              if (HObjList.Count > MAXNUMOBJLIST)
            HObjList.RemoveAt(1);
        }
        /********************************************************************/
        /*                      GRAPHICSSTACK                               */
        /********************************************************************/
        /// <summary>
        /// Adds an iconic object to the graphics stack similar to the way
        /// it is defined for the HDevelop graphics stack.
        /// </summary>
        /// <param name="obj">Iconic object</param>
        public void addIconicVar(HObject obj)
        {
            HObjectEntry entry;

              if (obj == null)
              return;

              if (obj is HImage)
              {
            double r, c;
            int h, w, area;
            string s;

            area = ((HImage)obj).GetDomain().AreaCenter(out r, out c);
            ((HImage)obj).GetImagePointer1(out s, out w, out h);

            if (area == (w * h))
            {
              clearList();
              // MODIFIED
              if ((h != heightImagePart) || (w != widthImagePart))
              {
                heightImagePart = h;
                widthImagePart = w;
                resetImagePart(widthImagePart, heightImagePart);
              }
            }//if
              }//if

              entry = new HObjectEntry(obj, mGC.copyContextList());

              HObjList.Add(entry);

              if (HObjList.Count > MAXNUMOBJLIST)
              HObjList.RemoveAt(1);
        }