Ejemplo n.º 1
0
        private MainWindow(Builder builder)
            : base(builder.GetObject("MainWindow").Handle)
        {
            builder.Autoconnect(this);
            DeleteEvent += OnWindowDeleteEvent;

            skiaView = new SKDrawingArea();
            skiaView.PaintSurface += OnPaintSurface;
            skiaView.Show();
            Child = skiaView;
        }
Ejemplo n.º 2
0
        public GtkDrawspace(GraphicsProvider provider, Rect2D subrect)
        {
            Provider             = provider;
            _lastPaintTime       = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
            _window              = new Window("Drawspace");
            _window.DeleteEvent += OnWindowDeleteEvent;
            _window.SetDefaultSize((int)subrect.Size.X, (int)subrect.Size.Y);
            _window.Move((int)subrect.Position.X, (int)subrect.Position.Y);
            _skiaView = new SKDrawingArea();
            _skiaView.PaintSurface += OnPaintSurface;
            _skiaView.Show();
            _window.Child = _skiaView;

            TEXTALIGN[(int)IDrawspace.HORIZONTAL_ALIGNMENT.LEFT]   = SKTextAlign.Left;
            TEXTALIGN[(int)IDrawspace.HORIZONTAL_ALIGNMENT.CENTER] = SKTextAlign.Center;
            TEXTALIGN[(int)IDrawspace.HORIZONTAL_ALIGNMENT.RIGHT]  = SKTextAlign.Right;
            _skiaView.PaintSurface += OnPaintSurface;
            // init matrix stack
            _xformStack.Push(SKMatrix.MakeIdentity());
            _window.ShowAll();
        }