Example #1
0
        private void DrawCurrentPage(Graphics oGraphics, Rectangle oBounds)
        {
            Point[] oPoints =
            {
                new Point(oBounds.Left,  oBounds.Top),
                new Point(oBounds.Right, oBounds.Bottom)
            };
            oGraphics.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 = oGraphics.GetHdc();
            oRangeToFormat.rc         = oRangeToFormat.rcPage = oPrintRectangle;
            oRangeToFormat.chrg.cpMin = m_iPosition;
            oRangeToFormat.chrg.cpMax = m_iPrintEnd;

            m_iPosition = m_oScintillaControl.NativeInterface.FormatRange(true, ref oRangeToFormat);
        }
Example #2
0
		private void DrawCurrentPage(Graphics oGraphics, Rectangle oBounds)
		{
			Point[] oPoints = {
                new Point(oBounds.Left, oBounds.Top),
                new Point(oBounds.Right, oBounds.Bottom)
                };
			oGraphics.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 = oGraphics.GetHdc();
			oRangeToFormat.rc = oRangeToFormat.rcPage = oPrintRectangle;
			oRangeToFormat.chrg.cpMin = m_iPosition;
			oRangeToFormat.chrg.cpMax = m_iPrintEnd;

			m_iPosition = m_oScintillaControl.NativeInterface.FormatRange(true, ref oRangeToFormat);
			
		}
		unsafe int INativeScintilla.FormatRange(bool bDraw, ref RangeToFormat pfr)
		{
			fixed(RangeToFormat* rtfp = &pfr)
				return (int)_ns.SendMessageDirect(Constants.SCI_FORMATRANGE, (IntPtr)(bDraw ? 1 : 0), (IntPtr)rtfp);
		}