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


C# Text.SetTextString方法代码示例

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


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

示例1: ChartOnFillSceneGraph

        private static void ChartOnFillSceneGraph(object sender, FillSceneGraphEventArgs e)
        {
           
            var axisY = e.Grid["Y"] as IAdvanceAxis;
            var axisX = e.Grid["X"] as IAdvanceAxis;

            int targetYCoord = Convert.ToInt32(axisY.Map(0));

            int xStart = Convert.ToInt32(axisX.MapMinimum);
            int xEnd = Convert.ToInt32(axisX.MapMaximum);
            int yStart = Convert.ToInt32(axisY.MapMinimum);
            int yEnd = Convert.ToInt32(axisY.MapMaximum);

            Line targetLine = new Line(new Point(xStart, targetYCoord), new Point(xEnd, targetYCoord))
            {
                PE =
                {
                    Stroke = Color.Green,
                    StrokeWidth = 2
                },
                lineStyle =
                {
                    DrawStyle = LineDrawStyle.Solid
                     
                }
            };
            e.SceneGraph.Add(targetLine);

            var waermerLabel = new Text();
            waermerLabel.SetTextString("wärmer");
            waermerLabel.SetLabelStyle(new LabelStyle { FontColor = Color.Black, Font = new Font("Verdana", 8, FontStyle.Regular, GraphicsUnit.Point) });
            Size waermerLabelSize = Size.Ceiling(Platform.GetLabelSizePixels(waermerLabel.GetTextString(), waermerLabel.labelStyle));
            waermerLabel.bounds = new Rectangle(xStart + 5, yEnd - waermerLabelSize.Height, waermerLabelSize.Width, waermerLabelSize.Height);
            e.SceneGraph.Add(waermerLabel);

            var kaelterLabel = new Text();
            kaelterLabel.SetTextString("kälter");
            kaelterLabel.SetLabelStyle(new LabelStyle { FontColor = Color.Black, Font = new Font("Verdana", 8, FontStyle.Regular, GraphicsUnit.Point) });
            Size kaelterLabelSize = Size.Ceiling(Platform.GetLabelSizePixels(kaelterLabel.GetTextString(), kaelterLabel.labelStyle));
            kaelterLabel.bounds = new Rectangle(xStart + 5, yStart , kaelterLabelSize.Width, kaelterLabelSize.Height);
            e.SceneGraph.Add(kaelterLabel);
        }
开发者ID:bpug,项目名称:MetronaWT,代码行数:42,代码来源:MonatsRelativeVerteilungJahrChart.cs

示例2: TemperaturChartFillSceneGraph

        private static void TemperaturChartFillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
        {
            double target = 15;
            IAdvanceAxis axisY = e.Grid["Y"] as IAdvanceAxis;
            IAdvanceAxis axisX = e.Grid["X"] as IAdvanceAxis;

            int targetYCoord = Convert.ToInt32(axisY.Map(target));
            int xStart = Convert.ToInt32(axisX.MapMinimum);
            int xEnd = Convert.ToInt32(axisX.MapMaximum);

            Line targetLine = new Line(new Point(xStart, targetYCoord), new Point(xEnd, targetYCoord));

            targetLine.PE.Stroke = Color.Green;
            targetLine.PE.StrokeWidth = 1;


            //e.SceneGraph.Add(targetLine)

            Text targetLabel = new Text();
            targetLabel.SetTextString("Heizgrenztemperatur");
            Size targetLabelSize = Size.Ceiling(Platform.GetLabelSizePixels(targetLabel.GetTextString(), targetLabel.labelStyle));
            targetLabel.bounds = new Rectangle(xStart + 10, targetYCoord - targetLabelSize.Height, targetLabelSize.Width, targetLabelSize.Height);
            e.SceneGraph.Add(targetLabel);
        }
开发者ID:bpug,项目名称:MetronaWT,代码行数:24,代码来源:TemperaturChart.cs

示例3: ChartOnFillSceneGraph

        private static void ChartOnFillSceneGraph(object sender, FillSceneGraphEventArgs e)
        {

            //List<Primitive> boxes = e.SceneGraph.Cast<Primitive>().Where(p => p is Box && p.Row > -1).ToList();

            //foreach (var box in boxes)
            //{
            //    Point loc = ((Box)box).rect.Location;

            //    //loc.Offset(((Box)box).rect.Width, ((Box)box).rect.Height);
            //    loc.Offset(0, -20);

            //    //Rectangle rect = new Rectangle(loc, new Size(((Box)box).rect.Width, 25));

            //    Text t = new Text(loc, box.Value.ToString());
            //    t.SetLabelStyle(new LabelStyle { FontColor = Color.Black });
            //    // new LabelStyle(this.Font, Color.Black, false, false, false, StringAlignment.Center, StringAlignment.Center, TextOrientation.Horizontal)); 
            //    //e.SceneGraph.Add(t);
            //}

            var chart = sender as UltraChartEx;

            if (chart == null)
            {
                return;
            }
            var data = chart.ExtraData as MeteoGtzYear;


            var relativeData = data.ToRelativeData();
            var relativeDataForChart = data.ToRelativeDataForChart();
           
            //Aktuelles Jahr
            var aktuellJahr = relativeDataForChart.Period1;
            var lgtz = relativeDataForChart.Lgtz; 

            var axisY = e.Grid["Y"] as IAdvanceAxis;
            var axisX = e.Grid["X"] as IAdvanceAxis;

            int targetYCoord = Convert.ToInt32(axisY.Map(lgtz));

            int aktuellJahrY = Convert.ToInt32(axisY.Map(aktuellJahr));

            int nullY = Convert.ToInt32(axisY.Map(0));

            var margin = MarginX * 3.5;
            if (!isPdf)
            {
                margin = MarginX * 6.2;
            }

            int xStart = Convert.ToInt32(axisX.MapMinimum - margin);
            int xEnd = Convert.ToInt32(axisX.MapMaximum + margin + (isPdf ? 32 :15));

            Line nullLine = new Line(new Point(xStart, nullY), new Point(xEnd, nullY))
            {
                PE =
                {
                    Stroke = Color.Black,
                    StrokeWidth = 1
                },
                lineStyle =
                {
                    DrawStyle = LineDrawStyle.Solid

                }
            };

            e.SceneGraph.Add(nullLine);

            var annLabel = new Text();
            annLabel.SetTextString(GetAnnotationText(relativeData.Lgtz, "das Langzeitmittel" + Environment.NewLine + "ist"));
            annLabel.SetLabelStyle(new LabelStyle { FontColor = Constants.YearsChartColors[3], Font = new Font("Verdana", isPdf ? 6f : 8.5f, FontStyle.Italic, GraphicsUnit.Point) });
            Size annLabelSize = Size.Ceiling(Platform.GetLabelSizePixels(annLabel.GetTextString(), annLabel.labelStyle));
            annLabel.bounds = new Rectangle(xEnd - annLabelSize.Width, targetYCoord - annLabelSize.Height / 2, annLabelSize.Width, annLabelSize.Height);
            e.SceneGraph.Add(annLabel);

            Line targetLine = new Line(new Point(xStart, targetYCoord), new Point(xEnd - annLabelSize.Width - 2, targetYCoord))
            {
                PE =
                {
                    Stroke = Constants.YearsChartColors[3],
                    StrokeWidth = 2
                },
                lineStyle =
                {
                    DrawStyle = LineDrawStyle.Dash
                     
                }
            };
            
            e.SceneGraph.Add(targetLine);

            var targetLabel = new Text();
            targetLabel.SetTextString("Langzeitmittel");
            targetLabel.SetLabelStyle(new LabelStyle { FontColor = Constants.YearsChartColors[3] });
            Size targetLabelSize = Size.Ceiling(Platform.GetLabelSizePixels(targetLabel.GetTextString(), targetLabel.labelStyle));
            targetLabel.bounds = new Rectangle(xStart - (targetLabelSize.Width - (isPdf ? 10 : 0)), targetYCoord - targetLabelSize.Height / 2, targetLabelSize.Width, targetLabelSize.Height);

            e.SceneGraph.Add(targetLabel);
//.........这里部分代码省略.........
开发者ID:bpug,项目名称:MetronaWT,代码行数:101,代码来源:JahresbetrachtungChart.cs


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