Esempio n. 1
0
            void IChartResizer.Resize(int xold, int yold, int xnew, int ynew)
            {
                int xp = xold;
                int yp = yold;
                int xc = xnew;
                int yc = ynew;

                if ((xp < xc) & (yp < yc))
                {
                    double xb = performer.dSize[0, 0];
                    double xd = performer.dSize[1, 0] - performer.dSize[0, 0];
                    performer.dSize[0, 0] = xb + (double)xp * xd / (double)(performer.size[0]);
                    performer.dSize[1, 0] = xb + (double)xc * xd / (double)(performer.size[0]);
                    double yb = performer.dSize[1, 1];
                    double yd = performer.dSize[1, 1] - performer.dSize[0, 1];
                    performer.dSize[0, 1] = yb - (double)yc * yd / (double)(performer.size[1]);
                    performer.dSize[1, 1] = yb - (double)yp * yd / (double)(performer.size[1]);
                    performer.Refresh();
                }
                else
                {
                    performer.RefreshAll();
                }
                Graphics g = Graphics.FromImage(performer.iTemp);

                g.DrawImage(performer.image, 0, 0);
                g.Dispose();
                performer.isMoved = false;
            }
        void ShowChart()
        {
            Chart.ChartPerformer performer = userControlChart.Performer;
            performer.RemoveAll();
            ISeriesPainter sp = painterInreface.Painter;

            if (sp != null)
            {
                DataPerformer.Series series = nc as DataPerformer.Series;
                SeriesGraph          ser    = new SeriesGraph(series);
                performer.AddSeries(ser, sp);
            }
            performer.RefreshAll();
        }