Exemple #1
0
        /// <summary>
        /// Prints the component in this scroll pane. </summary>
        /// <param name="g"> the specified Graphics window </param>
        /// <seealso cref= Component#print </seealso>
        /// <seealso cref= Component#printAll </seealso>
        public override void PrintComponents(Graphics g)
        {
            if (ComponentCount == 0)
            {
                return;
            }
            Component c  = GetComponent(0);
            Point     p  = c.Location;
            Dimension vs = ViewportSize;
            Insets    i  = Insets;

            Graphics cg = g.Create();

            try
            {
                cg.ClipRect(i.Left, i.Top, vs.Width_Renamed, vs.Height_Renamed);
                cg.Translate(p.x, p.y);
                c.PrintAll(cg);
            }
            finally
            {
                cg.Dispose();
            }
        }