示例#1
0
 public void func_draw(double xoff, double yoff, CellRange viz, IBoxGetter box, TGraphics gr)
 {
     _cd.func_begin_update(viz);
     for (int row = viz.row_first; row <= viz.row_last; row++)
     {
         for (int col = viz.col_first; col <= viz.col_last; col++)
         {
             double cx;
             double cy;
             double cwidth;
             double cheight;
             box.GetBox(col, row,
                        out cx,
                        out cy,
                        out cwidth,
                        out cheight
                        );
             _cd.func_cell_draw(col, row, xoff + cx, yoff + cy, cwidth, cheight, gr);
         }
     }
     _cd.func_end_update();
 }
            public void get_image(cimg prev, IDrawVisible <IGraphics> next, CellRange viz, IBoxGetter box, IGraphics gr)
            {
                range = viz;

                double width = 0;

                for (int i = range.col_first; i <= range.col_last; i++)
                {
                    double cx;
                    double cy;
                    double cwidth;
                    double cheight;
                    box.GetBox(i, 0,
                               out cx,
                               out cy,
                               out cwidth,
                               out cheight
                               );
                    if (i == range.col_first)
                    {
                        xorigin = cx;
                    }
                    width += cwidth;
                }

                double height = 0;

                for (int i = range.row_first; i <= range.row_last; i++)
                {
                    double cx;
                    double cy;
                    double cwidth;
                    double cheight;
                    box.GetBox(0, i,
                               out cx,
                               out cy,
                               out cwidth,
                               out cheight
                               );
                    if (i == range.row_first)
                    {
                        yorigin = cy;
                    }
                    height += cheight;
                }

                //destroy ();
                gr.BeginOffscreen((float)width, (float)height, img);
                if (
                    (prev == null) ||
                    (null == prev.range) ||
                    (null == prev.range.Intersect(range))
                    )
                {
                    next.func_draw(-xorigin, -yorigin, range, box, gr);
                }
                else
                {
                    prev.draw(-xorigin, -yorigin, gr);
                    List <CellRange> missing = range.Subtract(prev.range);
                    foreach (CellRange mv in missing)
                    {
                        next.func_draw(-xorigin, -yorigin, mv, box, gr);
                    }
                }
                img = gr.EndOffscreen();
            }