Exemplo n.º 1
0
        /// <summary>
        /// Creates the NextPage Bitmap
        /// </summary>
        /// <param name="g"></param>
        /// <param name="cst"></param>
        /// <returns></returns>
        private Bitmap CreateNextPageBitmap(Graphics g, Office2007ScrollBarStateColorTable cst)
        {
            Bitmap bmp = new Bitmap(10, 10, g);

            using (Graphics gBmp = Graphics.FromImage(bmp))
            {
                using (GraphicsPath path = new GraphicsPath())
                {
                    float angle;

                    if (Orientation == eOrientation.Horizontal)
                    {
                        angle = 90;

                        path.AddLines(new Point[] {
                            new Point(1,0),
                            new Point(5,4), 
                            new Point(1,8)
                            });

                        path.CloseFigure();

                        path.AddLines(new Point[] {
                            new Point(5,0),
                            new Point(9,4),
                            new Point(5,8)
                            });

                        path.CloseFigure();
                    }
                    else
                    {
                        angle = 0;

                        path.AddLines(new Point[] {
                            new Point(1,0),
                            new Point(8,0),
                            new Point(4,4)
                            });

                        path.CloseFigure();

                        path.AddLines(new Point[] {
                            new Point(1,4),
                            new Point(8,4),
                            new Point(4,8)
                            });

                        path.CloseFigure();
                    }

                    Rectangle r = new Rectangle(0, 0, 10, 10);

                    DisplayHelp.FillPath(gBmp, path, cst.ThumbSignBackground);
                    //using (LinearGradientBrush lbr = new
                    //    LinearGradientBrush(r, cst.ThumbSignBackground.Start, cst.ThumbSignBackground.End, angle))
                    //{
                    //    gBmp.FillPath(lbr, path);
                    //}
                }
            }

            return (bmp);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the NextPage Bitmap
        /// </summary>
        /// <param name="g"></param>
        /// <param name="cst"></param>
        /// <returns></returns>
        private Bitmap GetNextPageBitmap(Graphics g, Office2007ScrollBarStateColorTable cst)
        {
            if (_NextPageBitmap == null)
                _NextPageBitmap = CreateNextPageBitmap(g, cst);

            return (_NextPageBitmap);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates the Today Bitmap
        /// </summary>
        /// <param name="g"></param>
        /// <param name="cst"></param>
        /// <returns></returns>
        private Bitmap CreateTodayBitmap(
            Graphics g, Office2007ScrollBarStateColorTable cst)
        {
            Bitmap bmp = new Bitmap(10, 10, g);

            using (Graphics gBmp = Graphics.FromImage(bmp))
            {
                Rectangle r = new Rectangle(1, 1, 6, 6);

                gBmp.SmoothingMode = SmoothingMode.HighQuality;

                Color color = ControlPaint.LightLight(cst.ThumbSignBackground.Start);

                using (SolidBrush br = new SolidBrush(color))
                {
                    gBmp.FillEllipse(br, r);
                }

                using (Pen pen = new Pen(cst.ThumbSignBackground.End))
                {
                    gBmp.DrawEllipse(pen, r);
                }
            }

            return (bmp);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the Today Bitmap
        /// </summary>
        /// <param name="g"></param>
        /// <param name="cst"></param>
        /// <returns></returns>
        private Bitmap GetTodayBitmap(
            Graphics g, Office2007ScrollBarStateColorTable cst)
        {
            if (_TodayBitmap == null)
                _TodayBitmap = CreateTodayBitmap(g, cst);

            return (_TodayBitmap);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates the PreviousPage bitmap
        /// </summary>
        /// <param name="g"></param>
        /// <param name="cst"></param>
        /// <returns></returns>
        private Bitmap CreatePreviousPageBitmap(
            Graphics g, Office2007ScrollBarStateColorTable cst)
        {
            Bitmap bmp = new Bitmap(10, 10, g);

            using (Graphics gBmp = Graphics.FromImage(bmp))
            {
                using (GraphicsPath path = new GraphicsPath())
                {
                    float angle;

                    if (Orientation == eOrientation.Horizontal)
                    {
                        angle = 90;

                        path.AddLines(new Point[] {
                            new Point(8,0),
                            new Point(4,4),
                            new Point(8,8)
                            });

                        path.CloseFigure();

                        path.AddLines(new Point[] {
                            new Point(4,0),
                            new Point(0,4),
                            new Point(4,8)
                            });

                        path.CloseFigure();
                    }
                    else
                    {
                        angle = 0;

                        path.AddLines(new Point[] {
                            new Point(0,5),
                            new Point(4,0),
                            new Point(8,5)
                            });

                        path.CloseFigure();

                        path.AddLines(new Point[] {
                            new Point(0,9),
                            new Point(4,4),
                            new Point(8,9)
                            });

                        path.CloseFigure();
                    }

                    Rectangle r = new Rectangle(0, 0, 10, 10);

                    using (LinearGradientBrush lbr = new
                        LinearGradientBrush(r, cst.ThumbSignBackground.Start, cst.ThumbSignBackground.End, angle))
                    {
                        gBmp.FillPath(lbr, path);
                    }
                }
            }

            return (bmp);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets the PreviousPage bitmap
        /// </summary>
        /// <param name="g"></param>
        /// <param name="cst"></param>
        /// <returns></returns>
        private Bitmap GetPreviousPageBitmap(
            Graphics g, Office2007ScrollBarStateColorTable cst)
        {
            if (_PreviousPageBitmap == null)
                _PreviousPageBitmap = CreatePreviousPageBitmap(g, cst);

            return (_PreviousPageBitmap);
        }