示例#1
0
        /// <summary>
        ///     Creates a MapViewer control
        /// </summary>
        public MapViewer()
        {
            // Set styles needed to reduce flickering
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            // Initialize variables
            m_DrawObjects = new List <IMapDrawable>();

            // Create the default view. This will be most likely changed by the frame
            m_ViewInfo = new MapViewInfo(this);
        }
示例#2
0
        public void Draw(System.Drawing.Graphics g, TheBox.MapViewer.MapViewInfo ViewInfo)
        {
            System.Drawing.Point c = ViewInfo.MapToControl(new System.Drawing.Point(m_Spawn.X, m_Spawn.Y));

            int x1 = c.X - 3;
            int x2 = c.X + 3;
            int y1 = c.Y - 3;
            int y2 = c.Y + 3;

            Color color = Pandora.Profile.Travel.SpawnColor;

            Pen pen = new Pen(color);

            g.DrawLine(pen, x1, y1, x2, y2);
            g.DrawLine(pen, x1, y2, x2, y1);
            g.DrawLine(pen, c.X, y1, c.X, y2);
            g.DrawLine(pen, x1, c.Y, x2, c.Y);

            pen.Dispose();
        }
示例#3
0
		/// <summary>
		/// Creates a MapViewer control
		/// </summary>
		public MapViewer()
		{
			// Set styles needed to reduce flickering
			SetStyle( ControlStyles.DoubleBuffer, true );
			SetStyle( ControlStyles.UserPaint, true );
			SetStyle( ControlStyles.AllPaintingInWmPaint, true );

			// Initialize variables
			//m_MapArray = new ArrayList();
			m_ColorMap = new short[ 65536 ];
			// Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
			m_DrawObjects = new List<IMapDrawable>();
			// Issue 10 - End

			// Generate the Difl data
			GeneratePatchData();

			// Read the colors
			// Issues 43 - Problems when the client path isn't found - http://code.google.com/p/pandorasbox3/issues/detail?id=43 - Smjert
			if (!LoadRadarcol())
			{
				ErrMsgBox.Show("Impossible to load .mul files", "Error");
				Environment.Exit(1);
			}
			// Issues 43 - End
			

			// Create the default view. This will be most likely changed by the frame
			m_ViewInfo = new MapViewInfo( this );
		}