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


C# Main.CairoContextEx類代碼示例

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


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

示例1: Draw

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

            if (gametype == GameType.Present) {
                gr.DrawImageFromAssembly ("present.svg", 0.2, 0.4, 0.6, 0.2);
            } else {
                if (gametype == GameType.Fence)
                {
                    double x105, y105, y;
                    const double x = 0.35;
                    const double figure_size = 0.4;

                    x105 = figure_size * Math.Cos (105 * Math.PI / 180);
                    y105 = figure_size * Math.Sin (105 * Math.PI / 180);

                    y = (1 - y105) / 2;
                    gr.MoveTo (x, y);
                    gr.LineTo (x + x105, y + y105);
                    gr.LineTo (x + x105 + figure_size, y + y105);
                    gr.Stroke ();
                    gr.MoveTo (x + figure_size, y);
                    gr.LineTo (x + figure_size + x105, y + y105);
                    gr.Stroke ();
                    gr.MoveTo (x, y);
                    gr.LineTo (x + figure_size, y);
                    gr.Stroke ();
                }
            }
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:30,代碼來源:PuzzleCounting.cs

示例2: Draw

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

            if (String.IsNullOrEmpty (svg_image) == false)
                gr.DrawImageFromAssembly (svg_image, 0.25, 0.25, 0.5, 0.5);
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:7,代碼來源:PuzzlePercentage.cs

示例3: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            #if DESIGN_MODE
            gr.Save ();
            gr.Color = new Cairo.Color (1, 0, 0);
            gr.Rectangle (0, 0, Width, Height);
            gr.Stroke ();
            gr.Restore ();
            #endif

            if (hoover == true)
              			{
                double lw = gr.LineWidth;
                double [] dashes = {0.01,  /* ink */
                           0.01,  /* skip */ };

                gr.Save ();

                gr.Color = new Cairo.Color (0.5, 0.5, 0.5, 1);
                gr.SetDash (dashes, 0);

                if (SelectedArea.Width == 0 && SelectedArea.Height == 0)
                    gr.Rectangle (-lw, -lw, Width + lw * 2, Height + lw * 2);
                else
                    gr.Rectangle (SelectedArea.X -lw, SelectedArea.Y -lw, SelectedArea.Width + lw * 2, SelectedArea.Height + lw * 2);

                gr.Stroke ();
                gr.Restore ();
            }

            if (DrawEventHandler == null)
                return;

            DrawEventHandler (this, new DrawEventArgs (gr, Width, Height, rtl, Data));
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:35,代碼來源:DrawableArea.cs

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

示例5: 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.DrawTextCentered (0.5, DrawAreaY + 0.3, formula);
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:7,代碼來源:PuzzleEquation.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.Color = new Color (0.4, 0.4, 0.4);
        gr.DrawTextCentered (0.5, DrawAreaY, "This is an extension sample");
    }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:7,代碼來源:PuzzleSample.cs

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

示例8: DrawPossibleAnswers

        public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x= DrawAreaX, y = DrawAreaY + 0.1;
            int pos = 0;
            gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, DefaultDrawingColor.B, 1);

            if (Answer.Draw ==  true) {
                DrawAllFigures (gr, start_x_ans, start_y, area_width, area_height);
                return;
            }

            gr.SetPangoNormalFontSize ();
            for (int i = 0; i < figures.Length; i++)
            {
                if (i == question_pos)
                    continue;

                gr.MoveTo (x, y);
                gr.ShowPangoText (FigureType.ToString (figures[i]));

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

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

示例10: Draw

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

            DrawLine (gr, 0.1, 0.2, 0.4, 0.38);
            DrawLine (gr, 0.1, 0.3, 0.4, 0.3);
            DrawLine (gr, 0.1, 0.4, 0.4, 0.25);

            if (type == 1)  {
                DrawLine (gr, 0.6, 0.3, -0.2, 0.35);
                DrawLine (gr, 0.5, 0.25, -0.2, 0.35);
            }

            DrawLine (gr, 0.1, 0.25, 0.6, 0.1);
            DrawLine (gr, 0.25, 0.2, 0, 0.4);

            if (type == 2 || type == 1)  {
                DrawLine (gr, 0.85, 0.25, -0.2, 0.4);
                DrawLine (gr, 0.88, 0.25, -0.2, 0.4);
            }

            DrawLine (gr, 0.91, 0.25, -0.2, 0.4);
            DrawLine (gr, 0.8, 0.2, 0, 0.4);
            DrawLine (gr, 0.82, 0.2, 0, 0.4);
            DrawLine (gr, 0.6, 0.50, 0.25, 0);
            DrawLine (gr, 0.6, 0.53, 0.25, 0);
        }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:27,代碼來源:PuzzleLines.cs

示例11: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            base.Draw (gr, area_width, area_height, rtl);
            gr.DrawClock (DrawAreaX + 0.4, DrawAreaY + 0.4, figure_size,
                0, 0 /* No hands */);

            gr.DrawTextCentered (0.5, DrawAreaY + 0.3 + figure_size, Translations.GetString ("Sample clock"));
        }
開發者ID:dineshkummarc,項目名稱:gbrainy,代碼行數:8,代碼來源:PuzzleTimeNow.cs

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

示例13: DrawEventArgs

 public DrawEventArgs(CairoContextEx gr, double width, double height, bool rtl, object data)
 {
     Context = gr;
     Width = width;
     Height = height;
     Rtl = rtl;
     Data = data;
 }
開發者ID:GNOME,項目名稱:gbrainy,代碼行數:8,代碼來源:DrawEventArgs.cs

示例14: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            base.Draw (gr, area_width, area_height, rtl);
            gr.DrawImageFromAssembly ("people_table.svg", 0.2, 0.2, 0.6, 0.6);

            gr.DrawTextCentered (0.5, 0.85,
                Translations.GetString ("Two people in the table sitting across each other"));
        }
開發者ID:dineshkummarc,項目名稱:gbrainy,代碼行數:8,代碼來源:PuzzlePeopleTable.cs

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


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