/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }