Ejemplo n.º 1
0
        private void DrawCurrentPage(Graphics gr, Rectangle bounds)
        {
            Point[] oPoints =
            {
                new Point(bounds.Left,  bounds.Top),
                new Point(bounds.Right, bounds.Bottom)
            };
            gr.TransformPoints(CoordinateSpace.Device, CoordinateSpace.Page, oPoints);

            PrintRectangle oPrintRectangle = new PrintRectangle(oPoints[0].X, oPoints[0].Y, oPoints[1].X, oPoints[1].Y);

            RangeToFormat oRangeToFormat = new RangeToFormat();

            oRangeToFormat.hdc      = oRangeToFormat.hdcTarget = gr.GetHdc();
            oRangeToFormat.rc       = oRangeToFormat.rcPage = oPrintRectangle;
            oRangeToFormat.chrg.Min = _iPosition;
            oRangeToFormat.chrg.Max = _iPrintEnd;
            _iPosition = sci.FormatRange(true, ref oRangeToFormat);
        }
Ejemplo n.º 2
0
        private void DrawCurrentPage(Graphics gr, Rectangle bounds)
        {
            Point[] oPoints = {
                new Point(bounds.Left, bounds.Top),
                new Point(bounds.Right, bounds.Bottom)
                };
            gr.TransformPoints(CoordinateSpace.Device, CoordinateSpace.Page, oPoints);

            PrintRectangle oPrintRectangle = new PrintRectangle(oPoints[0].X, oPoints[0].Y, oPoints[1].X, oPoints[1].Y);

            RangeToFormat oRangeToFormat = new RangeToFormat();
            oRangeToFormat.hdc = oRangeToFormat.hdcTarget = gr.GetHdc();
            oRangeToFormat.rc = oRangeToFormat.rcPage = oPrintRectangle;
            oRangeToFormat.chrg.Min = _iPosition;
            oRangeToFormat.chrg.Max = _iPrintEnd;
            _iPosition = sci.FormatRange(true, ref oRangeToFormat);
        }
Ejemplo n.º 3
0
 internal unsafe int FormatRange(bool draw, ref RangeToFormat pfr)
 {
     fixed (RangeToFormat* rtfp = &pfr)
         return Ref.Send(Sci.SCI_FORMATRANGE, (IntPtr)(draw ? 1 : 0), (IntPtr)rtfp);
 }