当前位置: 首页>>代码示例>>C#>>正文


C# Chart.Dispose方法代码示例

本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.Chart.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.Dispose方法的具体用法?C# Chart.Dispose怎么用?C# Chart.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.DataVisualization.Charting.Chart的用法示例。


在下文中一共展示了Chart.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DumpColRowsPlot


//.........这里部分代码省略.........
                    tg.NColumns, tg.NRows, tg.ThumbWidth, tg.ThumbHeight,
                    wastedWidth, wastedHeight,
                    extraWidth, extraHeight,
                    newContainer.Width, newContainer.Height,
                    extraWidthPercent, extraHeightPercent,
                    newContainer.AspectRatio
                    ));

                int index;

                if (plotThresholds)
                    {
                    index = seriesWW.Points.AddXY (aspectRatio, wastedWidth * 100.0);
                    if (wastedWidth == 0.0)
                        seriesWW.Points[index].IsEmpty = true;

                    index = seriesWH.Points.AddXY (aspectRatio, wastedHeight * 100.0);
                    if (wastedHeight == 0.0)
                        seriesWH.Points[index].IsEmpty = true;
                    }

                seriesNCols.Points.AddXY (aspectRatio, tg.NColumns);
                seriesNRows.Points.AddXY (aspectRatio, tg.NRows);
                }
            chartArea.RecalculateAxesScale ();

            AddARAnnotation (chart, "Fullscreen 4:3\n(1.33)", 1.33, annotationFont, plotThresholds);
            AddARAnnotation (chart, "HD 16:9\n(1.78)", 1.78, annotationFont, plotThresholds);
            AddARAnnotation (chart, "Widescreen\n(1.85)", 1.85, annotationFont, plotThresholds);
            AddARAnnotation (chart, "CinemaScope\n(2.35)", 2.35, annotationFont, plotThresholds);
            AddARAnnotation (chart, "Ultra-Panavision\n(2.76)", 2.76, annotationFont, plotThresholds);

            AddARAnnotation (chart,
                    String.Format ("Layout Threshold\n({0:F2})",
                                crossoverThreshold),
                    crossoverThreshold,
                    _tnSettings.LayoutMode == ThumbnailSettings.LayoutModes.Auto ?
                        annotationFont : annotationItFont,
                    plotThresholds,
                    true);

            if (_tnSettings.RCOptimization && plotThresholds)
                {
                switch (_tnSettings.LayoutMode)
                    {
                    case ThumbnailSettings.LayoutModes.Auto:

                        if (_tnSettings.WidthThreshold == _tnSettings.HeightThreshold)
                            AddThresholdAnnotation (chart,
                                                   String.Format ("Width & Height Threshold\n" +
                                                                 "({0:F2})", _tnSettings.WidthThreshold),
                                                   _tnSettings.WidthThreshold,
                                                   annotationFont);
                        else
                            {
                            AddThresholdAnnotation (chart,
                                                   String.Format ("Width Threshold\n" +
                                                                 "({0:F2})", _tnSettings.WidthThreshold),
                                                   _tnSettings.WidthThreshold,
                                                   annotationFont);
                            AddThresholdAnnotation (chart,
                                                   String.Format ("Height Threshold\n" +
                                                                 "({0:F2})", _tnSettings.HeightThreshold),
                                                   _tnSettings.HeightThreshold,
                                                   annotationFont);
                            }
                        break;

                    case ThumbnailSettings.LayoutModes.RowPriority:
                        AddThresholdAnnotation (chart,
                                               String.Format ("Width Threshold\n" +
                                                             "({0:F2})", _tnSettings.WidthThreshold),
                                               _tnSettings.WidthThreshold,
                                               annotationFont);
                        break;

                    case ThumbnailSettings.LayoutModes.ColumnPriority:
                        AddThresholdAnnotation (chart,
                                               String.Format ("Height Threshold\n" +
                                                             "({0:F2})", _tnSettings.HeightThreshold),
                                               _tnSettings.HeightThreshold,
                                               annotationFont);
                        break;
                    }
                }

            chart.SaveImage (filename, Charting.ChartImageFormat.Png);
            THelper.Information ("'{0}' created.", filename);

            labelStyle1.Dispose ();
            labelStyle2.Dispose ();
            labelStyle3.Dispose ();

            titleFont.Dispose ();
            subTitleFont.Dispose ();
            axisFont.Dispose ();
            annotationFont.Dispose ();
            annotationItFont.Dispose ();
            chart.Dispose ();
        }
开发者ID:rm2,项目名称:CLAutoThumbnailer,代码行数:101,代码来源:CLAutoThumbnailer.cs


注:本文中的System.Windows.Forms.DataVisualization.Charting.Chart.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。