Esempio n. 1
0
        protected override void InnerDraw(GraphicsDisplay display, GeoStar.Core.TrackCancel cancel)
        {
            if (m_TileList.Count == 0)
            {
                return;
            }

            List <QuadTile> vList = new List <QuadTile>();

            lock (this)
            {
                vList.AddRange(m_TileList);
            }
            System.Windows.Media.DrawingContext dc = display.DrawingContext;
            foreach (var item in vList)
            {
                Box box = m_Pyramid.TileExtent(item.Level, item.Row, item.Col);
                System.Windows.Rect rect = display.DT.FromMapWPF(box);

                dc.DrawRectangle(null,
                                 new System.Windows.Media.Pen(System.Windows.Media.Brushes.Red, 1), rect);

                System.Windows.Media.FormattedText formattedText = new System.Windows.Media.FormattedText(
                    string.Format(" {0},{1},{2}", item.Level, item.Row, item.Col),
                    System.Globalization.CultureInfo.CurrentCulture,
                    System.Windows.FlowDirection.LeftToRight,
                    new  System.Windows.Media.Typeface("微软雅黑"),
                    12,
                    System.Windows.Media.Brushes.Black);


                dc.DrawText(formattedText, rect.Location);
            }
        }
Esempio n. 2
0
        public override void OnDraw(GraphicsDisplay disp)
        {
            if (!m_bStart)
            {
                return;
            }

            bool bDrawWFP = false;

            if (bDrawWFP)
            {
                //用WPF绘制
                Rect rect = disp.DT.FromMapWPF(Result);
                disp.DrawingContext.DrawRectangle(null, new System.Windows.Media.Pen(System.Windows.Media.Brushes.Blue, 1), rect);
            }
            else
            {
                //如果用内核绘制
                SimpleFillSymbol f = new SimpleFillSymbol(System.Drawing.Color.Transparent, System.Drawing.Color.Blue, 1);
                Canvas           c = disp.Canvas;
                f.StartDrawing(disp);
                f.Draw(new Envelope(Result));
                f.EndDrawing();
                disp.IncrementCanvasAction();
            }
        }
Esempio n. 3
0
        protected override bool BeforeDraw(GraphicsDisplay disp, RawPoint[] geoline, System.Windows.Point[] line)
        {
            Path     p   = new Path(geoline);
            Geometry geo = p.GeodesicBuffer(100000, GeoStar.Core.BufferCapType.eBufferFlatCap, 0.001);

            m_Sym.StartDrawing(disp);
            m_Sym.Draw(geo);
            m_Sym.EndDrawing();
            disp.IncrementCanvasAction();
            return(false);
        }
        public FormFirComplex()
        {
            InitializeComponent();
            int N = 1000;

            dataR                    = new double[N];
            dataP                    = new double[N];
            graphicsDisplay          = new GraphicsDisplay(dataR, dataP);
            graphicsDisplay.Location = new Point(25, 25);
            graphicsDisplay.Size     = new Size(1000, 400);
            Controls.Add(graphicsDisplay);
        }
Esempio n. 5
0
        protected override void Initialize()
        {
            Window.Position     = new Point(0, 0);
            Window.IsBorderless = true;
            JsonManager <Settings> json = new JsonManager <Settings>();

            Settings        = json.Load("settings.json");
            Log             = new Log("Log", Settings.LogPath);
            Camera          = new Camera(GraphicsDevice, Settings.CameraWidth, Settings.CameraHeight);
            GraphicsDisplay = new GraphicsDisplay(graphics, Window, Camera);
            GraphicsDisplay.SetResolution(Settings.ScreenWidth, Settings.ScreenHeight);
            Log.WriteLine("====> Starting Launcher.");
            Log.WriteLine("====> Initialization complete.");
            ValidateSettings();
            base.Initialize();
        }
Esempio n. 6
0
        public Display(byte id, VirtualMachine machine, RenderWindow window)
        {
            Id = id;

            _machine = machine;
            _window = window;

            _textDisplay = new TextDisplay(80, 25);

            _graphicsDisplay = new GraphicsDisplay(320, 200);
            _graphicsDisplay.Scale = new Vector2f(2, 2);

            _cursorEnabled = false;
            _cursorVisible = false;
            _cursorTimer = Stopwatch.StartNew();

            var cursorSize = new Vector2f(_textDisplay.CharacterWidth, _textDisplay.CharacterHeight * 0.15f);
            _cursor = new RectangleShape(cursorSize);
            _cursor.Origin = new Vector2f(0, -(_textDisplay.CharacterHeight * 0.85f));
            _cursor.FillColor = _textDisplay.PaletteGet(15);

            ChangeVideoMode(VideoMode.Text);
        }
Esempio n. 7
0
 protected override void Draw(GameTime gameTime)
 {
     Camera.Draw(gameTime, spriteBatch, currentScene);
     GraphicsDisplay.Draw(spriteBatch);
     base.Draw(gameTime);
 }