當前位置: 首頁>>代碼示例>>C#>>正文


C# DrawingContext.DrawText方法代碼示例

本文整理匯總了C#中System.Windows.Media.DrawingContext.DrawText方法的典型用法代碼示例。如果您正苦於以下問題:C# DrawingContext.DrawText方法的具體用法?C# DrawingContext.DrawText怎麽用?C# DrawingContext.DrawText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Media.DrawingContext的用法示例。


在下文中一共展示了DrawingContext.DrawText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnRender

        protected override void OnRender(DrawingContext dc)
        {
            Point curPoint = new Point(0, 0);

            dc.DrawText(MakeText("Row Number"), curPoint);
            curPoint.X += ColumnWidth;
            for (int i = 1; i < 4; i++)
            {
                dc.DrawText(MakeText("Column " + i), curPoint);
                curPoint.X += ColumnWidth;
            }

            curPoint.X = 0;
            curPoint.Y += LineHeight;

            dc.DrawRectangle(Brushes.Black, null,
              new Rect(curPoint, new Size(Width, 2)));
            curPoint.Y += HeaderHeight - LineHeight;

            Random numberGen = new Random();
            for (int i = _CurrentRow; i < _CurrentRow + _Rows; i++)
            {
                dc.DrawText(MakeText(i.ToString()), curPoint);
                curPoint.X += ColumnWidth;
                for (int j = 1; j < 4; j++)
                {
                    dc.DrawText(MakeText(numberGen.Next().ToString()), curPoint);
                    curPoint.X += ColumnWidth;
                }
                curPoint.Y += LineHeight;
                curPoint.X = 0;
            }
        }
開發者ID:ultrasonicsoft,項目名稱:CaseControlSystem_private,代碼行數:33,代碼來源:PageElement.cs

示例2: Init_DrawLT

        public void Init_DrawLT(int running_train)
        {
            int i;
            int temp;
            int late_time_range;
            late_time_range = 1000;
            temp = 0;
            x1 = 30;
            y1 = 10;
            x2 = 700;
            y2 = 580;
            narrow_x = (double)running_train / (x2 - x1);
            narrow_y = (double)late_time_range / (y2 - y1);
            drawingVisual = new DrawingVisual();
            dc = drawingVisual.RenderOpen();
            dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1, x1), new Point(x1, y2));
            dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1, y2), new Point(x2, y2));
            dc.DrawText(new FormattedText("N",
                    CultureInfo.GetCultureInfo("en-us"),
                    FlowDirection.LeftToRight,
                    new Typeface("Verdana"),
                    12, System.Windows.Media.Brushes.Black),
                    new System.Windows.Point(x2 - 30, y2 + 6));
            dc.DrawText(new FormattedText("T",
                      CultureInfo.GetCultureInfo("en-us"),
                      FlowDirection.LeftToRight,
                      new Typeface("Verdana"),
                      12, System.Windows.Media.Brushes.Black),
                      new System.Windows.Point(x1 - 10, y1 - 8));

            for (i = 0; i < (x2 - x1); i++)
            {
                if (i % ((x2 - x1) / 5) == 0)
                {
                    dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1 + i, y2), new Point(x1 + i, y2 - 3));
                    dc.DrawText(new FormattedText((temp * running_train / 5).ToString(),
                      CultureInfo.GetCultureInfo("en-us"),
                      FlowDirection.LeftToRight,
                      new Typeface("Verdana"),
                      12, System.Windows.Media.Brushes.Black),
                      new System.Windows.Point(i + x1 - 5, y2 + 7));
                    temp++;
                }
            }
            temp = 0;
            for (i = 0; i < (y2 - y1); i++)
            {
                if (i % ((y2 - y1) / 5) == 0)
                {
                    dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1, y2 - i), new Point(x1 + 3, y2 - i));
                    dc.DrawText(new FormattedText((temp * late_time_range / 5).ToString(),
                      CultureInfo.GetCultureInfo("en-us"),
                      FlowDirection.LeftToRight,
                      new Typeface("Verdana"),
                      12, System.Windows.Media.Brushes.Black),
                      new System.Windows.Point(x1 - 28, y2 - i - 9));
                    temp++;
                }
            }
        }
開發者ID:sonicrang,項目名稱:Train_TS,代碼行數:60,代碼來源:drawLT.cs

示例3: OnRender

        protected override void OnRender(DrawingContext drawingContext)
        {
            var fe = AdornedElement as FrameworkElement;
            if (fe == null)
            {
                return;
            }

            var rect = new Rect(1, 1, Math.Max(0, fe.ActualWidth - 2), Math.Max(0, fe.ActualHeight - 2));
            var color = Colors.Red;
            var brush = new SolidColorBrush(color);
            var pen = new Pen(brush, 1);
            pen.Freeze();

            var dashPen = new Pen(brush, 1) { DashStyle = new DashStyle(new double[] { 1, 6 }, 0) };
            dashPen.Freeze();

            var guidelineSet = new GuidelineSet();
            guidelineSet.GuidelinesX.Add(0.5);
            guidelineSet.GuidelinesY.Add(0.5);

            //var outlinePen = new Pen(new SolidColorBrush(Color.FromArgb(0x70, 0xFF, 0xFF, 0xFF)), 5);
            //outlinePen.Freeze();

            drawingContext.PushGuidelineSet(guidelineSet);

            //drawingContext.DrawRectangle(null, outlinePen, rect);
            drawingContext.DrawRectangle(null, pen, rect);

            //var parent = VisualTreeHelper.GetParent(fe) as FrameworkElement;
            //if (parent != null)
            //{
            //    var thisLeft = new Point(0, fe.ActualHeight / 2);
            //    var thisRight = new Point(fe.ActualWidth, fe.ActualHeight / 2);
            //    var thisTop = new Point(fe.ActualWidth / 2, 0);
            //    var thisBottom = new Point(fe.ActualWidth / 2, fe.ActualHeight);
            //    var ancestorLeft = new Point(parent.TranslatePoint(thisLeft, fe).X, thisLeft.Y);
            //    var ancestorRight = ancestorLeft + new Vector(parent.ActualWidth, 0);
            //    var ancestorTop = new Point(thisTop.X, parent.TranslatePoint(new Point(), fe).Y);
            //    var ancestorBottom = new Point(thisBottom.X, parent.TranslatePoint(new Point(), fe).Y + parent.ActualHeight);

            //    var leftPen = fe.HorizontalAlignment == HorizontalAlignment.Left || fe.HorizontalAlignment == HorizontalAlignment.Stretch ? pen : dashPen;
            //    var rightPen = fe.HorizontalAlignment == HorizontalAlignment.Right || fe.HorizontalAlignment == HorizontalAlignment.Stretch ? pen : dashPen;
            //    var topPen = fe.VerticalAlignment == VerticalAlignment.Top || fe.VerticalAlignment == VerticalAlignment.Stretch ? pen : dashPen;
            //    var bottomPen = fe.VerticalAlignment == VerticalAlignment.Bottom || fe.VerticalAlignment == VerticalAlignment.Stretch ? pen : dashPen;

            //    drawingContext.DrawLine(leftPen, thisLeft, ancestorLeft);
            //    drawingContext.DrawLine(rightPen, thisRight, ancestorRight);
            //    drawingContext.DrawLine(topPen, thisTop, ancestorTop);
            //    drawingContext.DrawLine(bottomPen, thisBottom, ancestorBottom);
            //}

            var formattedHeight = new FormattedText(string.Format("{0:0}", fe.ActualHeight), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, TypeFace, 10, brush);
            var formattedWidth = new FormattedText(string.Format("{0:0}", fe.ActualWidth), CultureInfo.InvariantCulture, FlowDirection.LeftToRight, TypeFace, 10, brush);
            drawingContext.DrawText(formattedHeight, new Point(rect.Width + 5, (rect.Height / 2) - (formattedHeight.Height / 2)));
            drawingContext.DrawText(formattedWidth, new Point(rect.Width / 2 - formattedWidth.Width / 2, rect.Height + 5));

            drawingContext.Pop();
        }
開發者ID:bdurrani,項目名稱:WPF-Inspector,代碼行數:59,代碼來源:SelectionAdorner.cs

示例4: Init_DrawSP

 public void Init_DrawSP(ArrayList sp, int track_len, int v_max)
 {
     int i;
     int temp;
     mysp = sp;
     temp = 0;
     x1 = 30;
     y1 = 10;
     x2 = 700;
     y2 = 580;
     narrow_x = (double)track_len / (x2-x1);
     narrow_y = (double)v_max / ((y2 - y1) / 2);
     drawingVisual = new DrawingVisual();
     dc = drawingVisual.RenderOpen();
     dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1, x1), new Point(x1, y2));
     dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1, y2), new Point(x2, y2));
     dc.DrawText(new FormattedText("T",
               CultureInfo.GetCultureInfo("en-us"),
               FlowDirection.LeftToRight,
               new Typeface("Verdana"),
               12, System.Windows.Media.Brushes.Black),
               new System.Windows.Point(x2 - 30, y2 + 6));
     dc.DrawText(new FormattedText("V",
               CultureInfo.GetCultureInfo("en-us"),
               FlowDirection.LeftToRight,
               new Typeface("Verdana"),
               12, System.Windows.Media.Brushes.Black),
               new System.Windows.Point(x1 - 10, y1 - 8));
     for (i = 0; i < (x2 - x1); i++)
     {
         if (i % ((x2 - x1) / 5) == 0)
         {
             dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1 + i, y2), new Point(x1 + i, y2 - 3));
             dc.DrawText(new FormattedText((temp * track_len / 5).ToString(),
               CultureInfo.GetCultureInfo("en-us"),
               FlowDirection.LeftToRight,
               new Typeface("Verdana"),
               12, System.Windows.Media.Brushes.Black),
               new System.Windows.Point(i + x1 - 5, y2 + 7));
             temp++;
         }
     }
     temp = 0;
     for (i = 0; i < (y2 - y1)/2; i++)
     {
         if (i % ((y2 - y1) / 10) == 0)
         {
             dc.DrawLine(new Pen(Brushes.Black, 1.5), new Point(x1, y2 - i), new Point(x1 + 3, y2 - i));
             dc.DrawText(new FormattedText((temp * v_max / 5).ToString(),
               CultureInfo.GetCultureInfo("en-us"),
               FlowDirection.LeftToRight,
               new Typeface("Verdana"),
               12, System.Windows.Media.Brushes.Black),
               new System.Windows.Point(x1 - 28, y2 - i - 9));
             temp++;
         }
     }
 }
開發者ID:sonicrang,項目名稱:Train_TS,代碼行數:58,代碼來源:drawSP.cs

示例5: RenderHorizontal

        private void RenderHorizontal(DrawingContext dc)
        {
            Pen p = new Pen(Brushes.Black, 1);
            Pen q = new Pen(Brushes.LightGray, 1);

            double padLeft = Padding.Left;
            double padBottom = Padding.Bottom - 2 + 10;
            double padTop = Padding.Top;
            double padRight = Padding.Right;

            // Draw horizontal gridlines

            for (int i = 0; i < 5; i++)
            {
                double y = (int)(padTop + (4 - i) * ((ActualHeight - padBottom - padTop) / 4.0)) - 0.5;
                if (i != 2)
                    dc.DrawLine(q, new Point(padLeft, y), new Point(ActualWidth - padRight, y));
                dc.DrawLine(p, new Point(padLeft - 10, y), new Point(padLeft, y));
                var t = FT((i / 2.0 - 1).ToString("0.0"), 10);
                dc.DrawText(t, new Point(padLeft - t.Width - 12, y - t.Height / 2));
            }

            // Draw vertical gridlines

            for (int i = 0; i < 11; i++)
            {
                double x = (int)(padLeft + (10 - i) * ((ActualWidth - padLeft - padRight) / 10.0)) - 0.5;
                if (i < 10)
                    dc.DrawLine(q, new Point(x, ActualHeight - padBottom), new Point(x, padTop));
                dc.DrawLine(p, new Point(x, ActualHeight - padBottom + 10), new Point(x, ActualHeight - padBottom));

                var t = FT(i.ToString(), 10);
                dc.DrawText(t, new Point(x - t.Width / 2, ActualHeight - padBottom + t.Height));
            }

            // Draw y axis

            dc.DrawLine(p, new Point(((int)padLeft) - 0.5, padTop), new Point(((int)padLeft) - 0.5, ActualHeight - padBottom));

            // Draw x axis
            dc.DrawLine(p, new Point(padLeft, ((int)((ActualHeight - padBottom - padTop) / 2 + padTop)) - 0.5), new Point(ActualWidth - padRight, ((int)((ActualHeight - padBottom - padTop) / 2 + padTop)) - 0.5));

            // Draw x axis label

            FormattedText ft = FT("History (seconds)", 20);
            dc.DrawText(ft, new Point(padLeft + (ActualWidth - padLeft - padRight) / 2 - ft.Width / 2, ActualHeight - ft.Height));

            // Draw y axis label

            ft = FT(RangeLabel, 20);
            dc.PushTransform(new RotateTransform(-90));
            dc.DrawText(ft, new Point(-ft.Width - ActualHeight / 2 + ft.Width / 2, 0));
        }
開發者ID:23119841,項目名稱:FERA-2015,代碼行數:53,代碼來源:AxesBorder.cs

示例6: Render

 public void Render(DrawingContext drawingContext, Point position, object item)
 {
     FileViewModel fileViewModel = item as FileViewModel;
       if (fileViewModel == null) return;
       FormattedText formattedText = new FormattedText(fileViewModel.Name, CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
     m_typeface, 14, Brushes.White);
       drawingContext.DrawText(formattedText, position);
       string path = Path.GetDirectoryName(fileViewModel.Path) ?? "";
       path = path.Length > ShortenPath ? path.Substring(ShortenPath, path.Length - ShortenPath) : "\\";
       FormattedText formattedTextSmall = new FormattedText(path, CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
     m_typeface, 10, Brushes.LightSlateGray);
       drawingContext.DrawText(formattedTextSmall, new Point(position.X + 5, position.Y + formattedText.Height));
 }
開發者ID:grarup,項目名稱:SharpE,代碼行數:13,代碼來源:FileItemRender.cs

示例7: DrawTextLeftAligned

 public static void DrawTextLeftAligned(this FormattedText ft, DrawingContext dc, Point topLeft)
 {
     if (ft.Text.Length > 0)
     {
         if (char.IsWhiteSpace(ft.Text[0]))
         {
             dc.DrawText(ft, new Point(topLeft.X, topLeft.Y));
         }
         else
         {
             dc.DrawText(ft, new Point(topLeft.X - ft.OverhangLeading, topLeft.Y));
         }
     }
 }
開發者ID:JackWangCUMT,項目名稱:math-editor,代碼行數:14,代碼來源:FormattedTextHelper.cs

示例8: OnRender

 protected override void OnRender(DrawingContext drawingContext)
 {
     foreach (MyText text in texts) {
         drawingContext.DrawText(text.line, text.Position);
     }
     Dispatcher.BeginInvoke(DispatcherPriority.Input, new Action(delegate { OnFrameRendered(EventArgs.Empty); }));
 }
開發者ID:akiotakahashi,項目名稱:WPF-Text-Rendering-Benchmark,代碼行數:7,代碼來源:FormattedTextMatrixView.cs

示例9: DrawPointElement

        protected override void DrawPointElement(DrawingContext dc, int Zoom)
        {
            if (Zoom > 12 || IsMouseOver)
            {
                string postLabelText = string.Format("{0}км", (double)Post.Ordinate / 1000);
                var postLabel = new FormattedText(postLabelText, CultureInfo.CurrentCulture,
                                                  FlowDirection.LeftToRight, new Typeface("Verdana"), 10, mainBrush);

                const int flagHeight = 22;
                dc.PushTransform(new TranslateTransform(0, -flagHeight));

                dc.DrawRectangle(Brushes.White, new Pen(mainBrush, 1), new Rect(-0.5, -0.5, Math.Round(postLabel.Width) + 5, Math.Round(postLabel.Height) + 2));
                dc.DrawText(postLabel, new Point(2, 0));
                dc.DrawLine(new Pen(mainBrush, 2), new Point(0, 0), new Point(0, flagHeight));

                dc.Pop();
            }

            if (Zoom > 8)
                dc.DrawEllipse(SectionBrush, new Pen(mainBrush, 1.5), new Point(0, 0), 5, 5);
            else
                dc.DrawRectangle(SectionBrush, null, new Rect(-2, -2, 4, 4));

            if (IsMouseOver)
            {
                dc.PushTransform(new TranslateTransform(3, 10));
                PrintStack(dc,
                           new FormattedText(Post.Direction == OrdinateDirection.Increasing ? "Возрастает по неч." : "Убывает по неч.",
                                             CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Verdana"), 10, Brushes.DarkBlue),
                           new FormattedText(String.Format("Пути: {0}", string.Join(", ", Post.Tracks.Select(TrackName))),
                                             CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Verdana"), 10, Brushes.DarkOliveGreen));
                dc.Pop();
            }
        }
開發者ID:NpoSaut,項目名稱:netEMapTools,代碼行數:34,代碼來源:KilometerPostMapElement.cs

示例10: OnRender

        protected override void OnRender(DrawingContext dc)
        {

            Size size = new Size(base.ActualWidth, base.ActualHeight);
            int tickCount = (int)((this.Maximum - this.Minimum) / this.TickFrequency) + 1;
            if ((this.Maximum - this.Minimum) % this.TickFrequency == 0)
                tickCount -= 1;
            Double tickFrequencySize;
            // Calculate tick's setting
            tickFrequencySize = (size.Width * this.TickFrequency / (this.Maximum - this.Minimum));
            string text = "";
            FormattedText formattedText = null;
            double num = this.Maximum - this.Minimum;
            int i = 0;
            // Draw each tick text
            for (i = 0; i <= tickCount; i++)
            {
                text = Convert.ToString(Convert.ToInt32(this.Minimum + this.TickFrequency * i), 10);
                //g.DrawString(text, font, brush, drawRect.Left + tickFrequencySize * i, drawRect.Top + drawRect.Height/2, stringFormat);

                formattedText = new FormattedText(text, CultureInfo.GetCultureInfo("ru-Ru"), FlowDirection.LeftToRight, new Typeface("Arial"), 8, Brushes.Black);
                dc.DrawText(formattedText, new Point((tickFrequencySize * i), 30));

            }
        }
開發者ID:leks4leks,項目名稱:ProgressoExpert,代碼行數:25,代碼來源:NumberedTickBar.cs

示例11: OnRender

    /// <summary>
    /// When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.
    /// </summary>
    /// <param name="drawingContext">The drawing instructions for a specific element. This context is provided to the layout system.</param>
    protected override void OnRender(DrawingContext drawingContext)
    {
      // When no interfaces have been defined, there is nothing to draw.
      if (this.interfaceNames.Count == 0)
      {
        return;
      }

      base.OnRender(drawingContext);

      Pen pen = new Pen(Brushes.Gray, 0.5);
      Point origin = new Point(30, 3);
      double length = Constants.StartHeight + (this.interfaceNames.Count * Constants.LineHeight);

      // draw path at top left
      drawingContext.DrawLine(pen, origin, new Point(origin.X, origin.Y - length));
      drawingContext.DrawEllipse(Brushes.Transparent, pen, new Point(origin.X, origin.Y - length - Constants.Radius), Constants.Radius, Constants.Radius);

      // draw interface names
      origin.Offset(5.0D, -length - Constants.Radius);
      foreach (string name in this.interfaceNames)
      {
        drawingContext.DrawText(new FormattedText(name, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface("Segoe UI"), 7, pen.Brush), origin);
        origin.Offset(0, 7.0D);
      }
    }
開發者ID:WrongDog,項目名稱:Sequence,代碼行數:30,代碼來源:DiagramSupplement.cs

示例12: Render

        public override void Render(DrawingContext dc, Point screenPoint)
        {
            Point dataPoint = screenPoint.ScreenToData(this.ct.Transform);
            Point dataPointZero = new Point(dataPoint.X,0.0);
            Point screenPointZero = dataPointZero.DataToScreen(this.ct.Transform);
            //const double verticalShift = 5; // px

            //dc.DrawLine(new Pen(Brushes.Black, 1), Point.Add(screenPoint, new Vector(0, 40)), screenPoint);

            double pointx = screenPointZero.X + 2;
            double pointy = screenPointZero.Y + 2;

            FormattedText textToDraw = new FormattedText(dataPoint.Y.ToString("0.000"), Thread.CurrentThread.CurrentCulture,
                   FlowDirection.LeftToRight, new Typeface("Arial"), 12, Brushes.Black);
            dc.DrawText(textToDraw, new Point(pointx, pointy));

            /*
            string svalue = dataPoint.Y.ToString("0.000");
            foreach (var s in svalue)
            {
                if (s.Equals('.'))
                    continue;
                FormattedText textToDraw = new FormattedText(s.ToString(), Thread.CurrentThread.CurrentCulture,
                    FlowDirection.LeftToRight, new Typeface("Arial"), 12, Brushes.Black);
                dc.DrawText(textToDraw, new Point(pointx,pointy));
                pointy = pointy + 10;

            }
             * */
        }
開發者ID:supercrawler,項目名稱:Chinchilla,代碼行數:30,代碼來源:XValueTextMarker.cs

示例13: OnRender

 protected override void OnRender(DrawingContext drawingContext)
 {
     base.OnRender(drawingContext);
     cent.X -= ft.Width / 2;
     cent.Y -= ft.Height / 2;
     drawingContext.DrawText(ft,cent);
 }
開發者ID:Ceasar,項目名稱:InkAnalysis,代碼行數:7,代碼來源:GistaFigure.cs

示例14: OnRender

 protected override void OnRender(DrawingContext drawingContext)
 {
     drawingContext.DrawRectangle(brush, pen, new Rect(corner, DesiredSize));
     center = new Point((DesiredSize.Width - formattedText.Width)/2, (DesiredSize.Height - formattedText.Height)/2);
     drawingContext.DrawText(formattedText, center);
     base.OnRender(drawingContext);
 }
開發者ID:MartyIX,項目名稱:SoTh,代碼行數:7,代碼來源:Fader.cs

示例15: BuildFaceModel

        void BuildFaceModel( DrawingContext dc )
        {
            if ( produced ) {
                FormattedText completed_msg = new FormattedText( "Status : Completed", CultureInfo.GetCultureInfo( "ja-JP" ), FlowDirection.LeftToRight, new Typeface( "Georgia" ), 25, Brushes.Green );
                dc.DrawText( completed_msg, new Point( 50, 50 ) );
                return;
            }
            if ( faceModelBuilder == null ) {
                return;
            }
            FaceModelBuilderCollectionStatus collection;
            collection = faceModelBuilder.CollectionStatus;
            if ( collection == 0 ) {
                return;
            }
            //Collection Status
            FormattedText text = new FormattedText( "Status : " + collection.ToString(), CultureInfo.GetCultureInfo( "ja-JP" ), FlowDirection.LeftToRight, new Typeface( "Georgia" ), 25, Brushes.Green );
            dc.DrawText( text, new Point( 50, 50 ) );
            String status = status2string( collection );
            text = new FormattedText( status, CultureInfo.GetCultureInfo( "ja-JP" ), FlowDirection.LeftToRight, new Typeface( "Georgia" ), 25, Brushes.Green );
            dc.DrawText( text, new Point( 50, 80 ) );

            //Capture Status
            FaceModelBuilderCaptureStatus capture;
            capture = faceModelBuilder.CaptureStatus;
            if ( capture == 0 ) {
                return;
            }
            status = status2string( capture );
            text = new FormattedText( status, CultureInfo.GetCultureInfo( "ja-JP" ), FlowDirection.LeftToRight, new Typeface( "Georgia" ), 25, Brushes.Green );
            dc.DrawText( text, new Point( 50, 110 ) );
            return;
        }
開發者ID:noa99kee,項目名稱:K4W2-Book,代碼行數:33,代碼來源:MainWindow.xaml.cs


注:本文中的System.Windows.Media.DrawingContext.DrawText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。