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


C# CairoContextEx.MoveTo方法代碼示例

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


在下文中一共展示了CairoContextEx.MoveTo方法的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: 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

示例4: Draw

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

            gr.SetPangoLargeFontSize ();
            gr.MoveTo (0.1, DrawAreaY);
            gr.ShowPangoText (Translations.GetString ("Choose one of the following:"));
        }
開發者ID:dineshkummarc,項目名稱:gbrainy,代碼行數:8,代碼來源:PuzzlePredicateLogic.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)
        {
            base.Draw (gr, area_width, area_height, rtl);

            gr.SetPangoLargeFontSize ();

            gr.MoveTo (0.1, 0.15);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Choose one of the following:"));
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:9,代碼來源:CalculationProportions.cs

示例7: Draw

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

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

            for (int i = 0; i < 2; i++)
                DrawFigureSequence (gr, x, DrawAreaY + sub_figure * i , i, true);

            DrawFigureSequence (gr, x, DrawAreaY + sub_figure * 2 , 2, false);

            gr.MoveTo (0.1, 0.62);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Choose one of the following:"));
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:14,代碼來源:PuzzleMissingPiece.cs

示例8: Draw

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

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

            for (int i = 0; i < 4; i++) {
                DrawQuestionFigures (gr, x, y, random_indices_questions [i]);
                x += space_figures;
            }

            gr.MoveTo (0.1, 0.4 - 0.02);
            gr.ShowPangoText (Translations.GetString ("Choose one of the following:"));
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:14,代碼來源:PuzzleTetris.cs

示例9: Draw

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

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

            gr.SetPangoLargeFontSize ();

            gr.MoveTo (x, DrawAreaY + 0.22);
            gr.ShowPangoText (String.Format (Translations.GetString ("x + y = {0}"), number_a + number_b));

            gr.MoveTo (x, DrawAreaY + 0.44);
            gr.ShowPangoText (String.Format (Translations.GetString ("have a ratio of {0}:{1}"), ratio_a, ratio_b));
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:14,代碼來源:CalculationRatio.cs

示例10: 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

示例11: 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

示例12: 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

示例13: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double operand_y = DrawAreaY + 0.2;
            const double operand_space = 0.1;
            const double aligned_pos = 0.58;

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

            gr.SetPangoLargeFontSize ();
            for (int i = 0; i < operands.Length - 1; i++)
            {
                gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[i].ToString ());
                gr.MoveTo (DrawAreaX + 0.2, operand_y + 0.03);

                switch (operation) {
                case Operation.Addition:
                    gr.ShowPangoText ("+");
                    break;
                case Operation.Subtraction:
                    gr.ShowPangoText ("-");
                    break;
                case Operation.Multiplication:
                    gr.ShowPangoText ("*");
                    break;
                }

                operand_y += operand_space;
            }

            gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[operands.Length - 1].ToString ());

            operand_y += 0.08;
            gr.MoveTo (DrawAreaX + 0.2, operand_y);
            gr.LineTo (DrawAreaX + 0.5, operand_y);
            gr.Stroke ();

            if (Answer.Draw) {
                gr.DrawTextAlignedRight (aligned_pos, operand_y + 0.03, Answer.Correct);
            }
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:40,代碼來源:CalculationArithmetical.cs

示例14: 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

示例15: DrawSlice

        private static void DrawSlice(CairoContextEx gr, double x, double y)
        {
            double degrees, x1, y1;

            degrees = 0;
            gr.MoveTo (x, y);
            x1 = x + radius * Math.Cos (degrees);
            y1 = y + radius * Math.Sin (degrees);
            gr.LineTo (x1, y1);
            gr.Stroke ();

            degrees = radian * 60;
            gr.MoveTo (x, y);
            x1 = x + radius * Math.Cos (degrees);
            y1 = y + radius * Math.Sin (degrees);
            gr.LineTo (x1, y1);
            gr.Stroke ();

            gr.Arc (x, y, radius, 0, radian * 60);
            gr.Stroke ();
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:21,代碼來源:PuzzleMissingSlice.cs


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