Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRDP/GdiTest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'GdiTest/Main.cs')
-rw-r--r--GdiTest/Main.cs40
1 files changed, 4 insertions, 36 deletions
diff --git a/GdiTest/Main.cs b/GdiTest/Main.cs
index 17cd08e..232dd72 100644
--- a/GdiTest/Main.cs
+++ b/GdiTest/Main.cs
@@ -1,6 +1,6 @@
using System;
-using Gtk;
using Cairo;
+using Gtk;
namespace GdiTest
{
@@ -11,10 +11,11 @@ namespace GdiTest
Application.Init ();
MainWindow w = new MainWindow ();
- DrawingArea a = new CairoGraphic ();
+ DrawingArea lineDrawingArea = new LineDrawingArea ();
Box box = new HBox (true, 0);
- box.Add (a);
+ box.Add (lineDrawingArea);
+
w.Add (box);
w.Resize (500, 500);
w.ShowAll ();
@@ -23,36 +24,3 @@ namespace GdiTest
}
}
}
-
-public class CairoGraphic : DrawingArea
-{
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- using (Context g = Gdk.CairoHelper.Create (args.Window))
- {
- g.Antialias = Antialias.None;
- g.LineWidth = 4;
-
- g.Color = new Color(1,0,0);
- g.MoveTo (10, 10);
- g.LineTo (110, 10);
- g.Stroke ();
-
- g.Color = new Color(0,1,0);
- g.MoveTo (10, 10);
- g.LineTo (10, 110);
- g.Stroke ();
-
- g.Color = new Color(0,0,1);
- g.MoveTo (10, 10);
- g.LineTo (110, 110);
- g.Stroke ();
-
- g.Color = new Color(0,0,0);
- Rectangle rect = new Rectangle(210, 10, 260, 110);
- g.Rectangle(rect);
- g.Stroke ();
- }
- return true;
- }
-}