Ejemplo n.º 1
0
        /********************************************************************/
        /*                      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))
                {
                    clearAllObjsAndRegions();

                    if ((h != imageHeight) || (w != imageWidth))
                    {
                        imageHeight   = h;
                        imageWidth    = w;
                        zoomWndFactor = (double)imageWidth / viewPort.Width;
                        setImagePart(0, 0, h, w);
                    }
                }        //if
            }            //if

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

            HObjList.Add(entry);

            if (HObjList.Count > MAXNUMOBJLIST)
            {
                HObjList.RemoveAt(1);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Clears all entries from the graphics stack
 /// </summary>
 public void clearAllObjsAndRegions()
 {
     HObjList.Clear();
     HRegionList.Clear();
 }