• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Main.CairoContextEx类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中gbrainy.Core.Main.CairoContextEx的典型用法代码示例。如果您正苦于以下问题:C# CairoContextEx类的具体用法?C# CairoContextEx怎么用?C# CairoContextEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CairoContextEx类属于gbrainy.Core.Main命名空间,在下文中一共展示了CairoContextEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Draw

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

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

            DrawRectangleWithText (gr, x, y, 0);
            DrawRectangleWithText (gr, x + figure_size + 0.2, y, 4);
            DrawRectangleWithText (gr, x + figure_size + 0.05, y + 0.2 + figure_size, 8);
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:10,代码来源:PuzzleSquaresAndLetters.cs


示例17: Draw

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

            if (problems[problem].single)
                gr.DrawImageFromAssembly ("dice.svg", 0.3, 0.3, 0.4, 0.4);
            else {
                gr.DrawImageFromAssembly ("dice.svg", 0.1, 0.3, 0.4, 0.4);
                gr.DrawImageFromAssembly ("dice.svg", 0.5, 0.3, 0.4, 0.4);
            }
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:11,代码来源:PuzzleDice.cs


示例18: Draw

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

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

            if (Answer.Draw)
                DrawAnswer (gr, x, y);

            DrawQuestion (gr, x, y);
        }
开发者ID:GNOME,项目名称:gbrainy,代码行数:11,代码来源:PuzzleSquareSheets.cs


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


示例20: DrawObjectToMemorize

        public override void DrawObjectToMemorize(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            string text = string.Empty;

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

            for (int i = 0; i < facts.Length; i++)
            {
                text += facts[i].fact;
                text += "\n\n";
            }
            gr.DrawStringWithWrapping (0.3, DrawAreaY + 0.2, text, 0.95 - 0.3);
        }
开发者ID:GNOME,项目名称:gbrainy,代码行数:13,代码来源:MemoryFacts.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# x11.Request类代码示例发布时间:2022-05-26
下一篇:
C# RDL.StyleInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap