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


C# CairoContextEx.Stroke方法代碼示例

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


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

示例1: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.2, y = DrawAreaY + 0.2, width = 0.4, height = 0.4;

            base.Draw (gr, area_width, area_height, rtl);

            gr.Rectangle (x, y, width, height);
            gr.Stroke ();

            gr.MoveTo (x, y + 0.1);
            gr.LineTo (x + width, y + 0.1);  // First horizontal
            gr.Stroke ();

            gr.MoveTo (x, y + 0.3);
            gr.LineTo (x + width - 0.1, y + 0.3); // Second horizontal
            gr.Stroke ();

            gr.MoveTo (x + 0.1, y);
            gr.LineTo (x + 0.1, y + height);  // First vertical
            gr.Stroke ();

            gr.MoveTo (x + 0.3, y);
            gr.LineTo (x + 0.3, y + height - 0.1);  // Second vertical
            gr.Stroke ();
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:25,代碼來源:PuzzleSquareSheets.cs

示例2: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.1, y = DrawAreaY + 0.2;
            const double witdh = 0.6, height = 0.5;

            base.Draw (gr, area_width, area_height, rtl);

            gr.MoveTo (x, y);
            gr.LineTo (x + witdh, y);
            gr.LineTo (x + witdh / 2, y + height / 2);
            gr.LineTo (x, y);
            gr.LineTo (x + 0.45, y + height /4);
            gr.Stroke ();

            if (type == 0) {
                gr.MoveTo (x + witdh / 2, y);
                gr.LineTo (x + witdh / 2, y + height / 2);
                gr.Stroke ();
            }

            gr.MoveTo (x + 0.152, y + 0.125);
            gr.LineTo (x + witdh, y);
            gr.Stroke ();

            if (Answer.Draw == false)
                return;

            // References
            gr.MoveTo (x - 0.02, y);
            gr.ShowPangoText ("a");

            gr.MoveTo (x + witdh /2  - 0.02, y);
            gr.ShowPangoText ("b");

            gr.MoveTo (x + witdh, y);
            gr.ShowPangoText ("c");

            gr.MoveTo (x + witdh /2  - 0.03, y + 0.07 - 0.02);
            gr.ShowPangoText ("d");

            gr.MoveTo (x + 0.11, y + 0.16);
            gr.ShowPangoText ("e");

            gr.MoveTo (x + 0.47, y + 0.16);
            gr.ShowPangoText ("f");

            gr.MoveTo (x + (witdh /2) - 0.01, y + 0.26);
            gr.ShowPangoText ("g");
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:49,代碼來源:PuzzleTriangles.cs

示例3: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double rect_w = DrawAreaWidth / rows;
            double rect_h = DrawAreaHeight / columns;

            base.Draw (gr, area_width, area_height, rtl);

            for (int column = 0; column < columns; column++) {
                for (int row = 0; row < rows; row++) {

                    gr.Color = DefaultDrawingColor;
                    gr.Rectangle (DrawAreaX + row * rect_w, DrawAreaY + column * rect_h, rect_w, rect_h);
                    gr.Stroke ();

                    gr.DrawTextCentered (DrawAreaX + (rect_w / 2) + column * rect_w, (rect_h / 2) + DrawAreaY + row * rect_h,
                        (numbers[column + (row * 4)]).ToString() );

                    if (numbers[column + (row * 4)] % divisor == 0 && good_pos != column + (row * 4)) {
                        gr.Arc (DrawAreaX + (rect_w / 2) + column * rect_w, (rect_h / 2) + DrawAreaY + row * rect_h,
                            0.05, 0, 2 * Math.PI);
                        gr.FillGradient (DrawAreaX + (rect_w / 2) + column * rect_w, (rect_h / 2) + DrawAreaY + row * rect_h,
                            0.05, 0.05);

                    }
                    gr.Stroke ();
                }
            }
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:28,代碼來源:PuzzleGridCircles.cs

示例4: DrawPossibleAnswers

    public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl)
    {
        double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
        int cnt = 0;

        for (int i = 0; i < showed; i++)
        {
            if (i == answer)
                continue;

            gr.MoveTo (x, y);
            gr.ShowPangoText (animals[animals_order[i]]);
            gr.Stroke ();

            if ((cnt + 1) % 3 == 0) {
                y += 0.2;
                x = DrawAreaX + 0.125;
            } else {
                x+= 0.25;
            }
            cnt++;
        }

        gr.Color = new Color (0.9, 0.9, 0.9);
        gr.DrawTextCentered (0.5, DrawAreaY, "This is an extension sample");
    }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:26,代碼來源:MemorySample.cs

示例5: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = 0.25, y = 0.25;

            base.Draw (gr, area_width, area_height, rtl);

            gr.Rectangle (x, y, width, height);
            gr.Stroke ();

            gr.MoveTo (x, y + height / 2);
            gr.LineTo (x + width, y + height / 2);
            gr.Stroke ();

            gr.MoveTo (x + width / 2, y);
            gr.LineTo (x + width / 2, y + height);
            gr.Stroke ();

            if (cover_zone1)
                CoverZone (gr, x, y);

            if (cover_zone2)
                CoverZone (gr, x + width / 2, y);

            if (cover_zone3)
                CoverZone (gr, x, y + height / 2);

            if (cover_zone4)
                CoverZone (gr, x + width / 2, y + height / 2);

            switch (partial_zone) {
                case 1:
                    break;
                case 2:
                    x += width / 2;
                    break;
                case 3:
                    y += height / 2;
                    break;
                case 4:
                    y += height / 2;
                    x += width / 2;
                    break;
            }

            DrawSection (gr, x, y);
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:46,代碼來源:PuzzleCoverPercentage.cs

示例6: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.1, y = DrawAreaY + 0.05;

            base.Draw (gr, area_width, area_height, rtl);

            for (int i = 0; i < circles.Length; i++)
            {
                gr.Arc (x + circles[i].x + 0.1, y + circles[i].y + 0.1, circles[i].rad, 0, 2 * Math.PI);
                gr.Stroke ();
            }
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:12,代碼來源:PuzzleCountCircles.cs

示例7: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = X, y = Y;

            this.rtl = rtl;

            #if DESIGN_MODE
            gr.Save ();
            gr.Color = new Cairo.Color (0, 0, 1);
            gr.Rectangle (X, Y, Width, Height);
            gr.Stroke ();
            gr.Restore ();

            double width = 0;

            foreach (Widget child in children)
            {
                width += child.Width;

                if (Height < child.Height)
                    throw new InvalidOperationException (String.Format ("Container height too small {0} < {1}", Height, child.Height));
            }

            if (Width < width)
                throw new InvalidOperationException (String.Format ("Container witdh too small {0} < {1}", Width, width));
            #endif
            //
            // Coordinates are stored right to left
            //
            if (rtl == false) {
                for (int i = 0; i < children.Count; i++)
                {
                    gr.Save ();
                    gr.Translate (x, y);

                    children[i].Draw (gr, area_width, area_height, rtl);
                    gr.Restore ();
                    x += children[i].Width;
                }
            } else {
                x += Width;
                for (int i = 0; i < children.Count; i++)
                {
                    x -= children[i].Width;
                    gr.Save ();
                    gr.Translate (x, y);
                    children[i].Draw (gr, area_width, area_height, rtl);
                    gr.Restore ();
                }
            }
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:51,代碼來源:HorizontalContainer.cs

示例8: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double rect_w = DrawAreaWidth / rows;
            double rect_h = DrawAreaHeight / columns;

            base.Draw (gr, area_width, area_height, rtl);

            for (int column = 0; column < columns; column++) {
                for (int row = 0; row < rows; row++) {
                    gr.Rectangle (DrawAreaX + row * rect_w, DrawAreaY + column * rect_h, rect_w, rect_h);
                }
            }

            gr.Stroke ();
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:15,代碼來源:PuzzleSquares.cs

示例9: DrawObjectToMemorize

        public override void DrawObjectToMemorize(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            base.DrawObjectToMemorize (gr, area_width, area_height, rtl);

            if (Answer.Draw == false) {
                for (int i = 0; i < indications.Length; i++)
                {
                    gr.MoveTo (0.3, 0.2 + i * 0.08);
                    gr.ShowPangoText (indications[i].ToString ());
                    gr.Stroke ();
                }
            } else {
                    for (int i = 0; i < indications.Length; i++)
                    {
                        gr.MoveTo (0.1, 0.2 + i * 0.08);
                        gr.ShowPangoText (indications[i].ToString ());
                        gr.Stroke ();
                    }
                    DrawPossibleAnswers (gr, 0.7, 0.3, WhichAnswer (answers[ans]));
                    gr.MoveTo (0.7, 0.5);
                    gr.ShowPangoText (Answer.GetFigureName (ans));
                    gr.Stroke ();
            }
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:24,代碼來源:MemoryIndications.cs

示例10: Draw

        public void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            gr.Scale (area_width, area_height);

            gr.LineWidth = 0.01;
            gr.Color = new Cairo.Color (0, 0, 0, 1);

            gr.SetPangoLargeFontSize ();
            gr.DrawTextCentered (0.5, 0.1, ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Get ready to memorize the next objects..."));
            gr.Stroke ();

            gr.SetPangoFontSize (0.35);
            gr.DrawTextCentered (0.5, 0.5, countdown_time.ToString ());
            gr.Stroke ();

            gr.Arc (0.5, 0.5, 0.25, 0, 2 * Math.PI);
            gr.Stroke ();
            gr.Arc (0.5, 0.5, 0.28, 0, 2 * Math.PI);
            gr.Stroke ();
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:20,代碼來源:CountDownView.cs

示例11: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = X, y = Y;

            this.rtl = rtl;

            #if DESIGN_MODE
            gr.Save ();
            gr.Color = new Cairo.Color (0, 0, 1);
            gr.Rectangle (X, Y, Width, Height);
            gr.Stroke ();
            gr.Restore ();

            ValidateDimensions ();
            #endif

            //
            // Coordinates are stored right to left
            //
            if (rtl == false) {
                for (int i = 0; i < children.Count; i++)
                {
                    gr.Save ();
                    gr.Translate (x, y);

                    children[i].Draw (gr, area_width, area_height, rtl);
                    gr.Restore ();
                    x += children[i].Width;
                }
            } else {
                x += Width;
                for (int i = 0; i < children.Count; i++)
                {
                    x -= children[i].Width;
                    gr.Save ();
                    gr.Translate (x, y);
                    children[i].Draw (gr, area_width, area_height, rtl);
                    gr.Restore ();
                }
            }
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:41,代碼來源:HorizontalContainer.cs

示例12: DrawPossibleAnswers

        public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
            int cnt = 0;

            for (int i = 0; i < showed; i++)
            {
                if (i == answer)
                    continue;

                gr.MoveTo (x, y);
                gr.ShowPangoText (words[words_order[i]]);
                gr.Stroke ();

                if ((cnt + 1) % 3 == 0) {
                    y += 0.2;
                    x = DrawAreaX + 0.125;
                } else {
                    x+= 0.25;
                }
                cnt++;
            }
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:23,代碼來源:MemoryWords.cs

示例13: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            const double aligned_pos = 0.58;

            base.Draw (gr, area_width, area_height, rtl);

            gr.SetPangoLargeFontSize ();
            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.2, number_a.ToString ());
            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.3, number_b.ToString ());
            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.4, number_c.ToString ());

            gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.5);
            gr.LineTo (DrawAreaX + 0.5, DrawAreaY + 0.5);
            gr.Stroke ();

            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.55, total.ToString ());

            gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.25);
            gr.ShowPangoText ((Answer.Draw == true) ? oper1.ToString () : "?");

            gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.35);
            gr.ShowPangoText ((Answer.Draw == true) ?  oper2.ToString () : "?");
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:23,代碼來源:CalculationOperator.cs

示例14: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.22, y = DrawAreaY + 0.2;
            double pos_x = x;
            double pos_y = y;
            Circle[] circles = null;

            base.Draw (gr, area_width, area_height, rtl);

            circles =  new Circle [] {
                new Circle (0.01, 0.06),
                new Circle (0.27, 0.06),
                new Circle (0.01, 0.21),
                new Circle (0.27, 0.21),
                new Circle (0.14, 0),
                new Circle (0.14, 0.29)
            };

            // Circle
            gr.Arc (pos_x + figure_size, pos_y + figure_size, figure_size, 0, 2 * Math.PI);
            gr.Stroke ();

            const double point_size = 0.01;
            for (int i = 0; i < circles.Length; i++) {
                gr.Arc (x + point_size + circles[i].x, y + point_size + circles[i].y, point_size, 0, 2 * Math.PI);
                gr.Fill ();
                gr.Stroke ();
            }

            gr.MoveTo (x + circles[2].x + 0.01, y + circles[2].y + 0.01);
            gr.LineTo (x + circles[1].x + 0.01, y + circles[1].y + 0.01);
            gr.Stroke ();

            gr.DrawTextCentered (pos_x + figure_size, pos_y + 0.08 + figure_size * 2,
                ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Two people in the table sitting across each other"));
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:36,代碼來源:PuzzlePeopleTable.cs

示例15: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX, y = 0.05;

            base.Draw (gr, area_width, area_height, rtl);

            gr.MoveTo (0.05, y);
            gr.SetPangoLargeFontSize ();
            gr.ShowPangoText (Translations.GetString ("Numbers"));
            y += 0.08;

            for (int n = 0; n < numbers.Length; n++)
            {
                gr.MoveTo (x, y);
                gr.ShowPangoText (numbers[n].ToString ());
                gr.Stroke ();
                x += 0.17;
            }

            y += 0.16;

            gr.MoveTo (0.05, y);
            gr.ShowPangoText (Translations.GetString ("Possible divisors"));
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:24,代碼來源:CalculationGreatestDivisor.cs


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