Ejemplo n.º 1
0
    protected override void OnPrintPage(PrintPageEventArgs e)
    {
        if (_label == null)
        {
            return;
        }
        // calculate bounds
        Rectangle  rc     = e.MarginBounds;
        float      scale  = 96f / 100f;
        RectangleF bounds = new RectangleF(
            rc.Left * scale, rc.Top * scale,
            rc.Width * scale, rc.Height * scale);

        // render from current offset
        int newOffset = _label.DrawToGraphics(e.Graphics, bounds, _offset);

        // update offset
        e.HasMorePages = newOffset != _offset && newOffset < int.MaxValue;
        _offset        = newOffset;
    }
Ejemplo n.º 2
0
        void _flex_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
        {
            if (_flex.Cols[e.Col].Name == "HTML")
            {
                // draw background
                e.DrawCell(DrawCellFlags.Background);

                // use the C1SuperLabel to draw the html text
                if (e.Bounds.Width > 0 && e.Bounds.Height > 0)
                {
                    _html.Text      = _flex.GetDataDisplay(e.Row, e.Col);
                    _html.BackColor = Color.Transparent;
                    _html.DrawToGraphics(e.Graphics, e.Bounds);
                }

                // and draw border last
                e.DrawCell(DrawCellFlags.Border);

                // we're done with this cell
                e.Handled = true;
            }
        }