Esempio n. 1
0
        /// <summary>
        /// 刷新地图
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="args"></param>
        private void ImageTimer_Tick(Object obj, EventArgs args)
        {
            if (null == MyArea.AreaBitMap || null == MyArea.AreaBitMap.MyBitmap)
            {
                return;
            }

            ImageBitmap = new Bitmap(MyArea.AreaBitMap.MyBitmap, ImagePanel.Width, ImagePanel.Height);

            //if (scalew < scaleh)
            //{
            //    ImageBitmap = new Bitmap(MyArea.AreaBitMap.MyBitmap, ImagePanel.Width, (int)(ConstInfor.MapHeight * scalew));
            //}
            //else
            //{
            //    ImageBitmap = new Bitmap(MyArea.AreaBitMap.MyBitmap, (int)(scaleh * ImagePanel.Width), ImagePanel.Height);
            //}
            DrawAreaMap.DrawBasicRouter(ImageBitmap, StrAreaID, 1, scalew, scaleh);
            RtAroundTagPlace.ClearAreaAllRouterStand(MyArea);
            IEnumerable <KeyValuePair <string, TagPack> > TEMP =
                CommonCollection.TagPacks.Reverse <KeyValuePair <string, TagPack> >();

            try{
                foreach (KeyValuePair <string, TagPack> tp in TEMP)
                {
                    if (null == tp.Value)
                    {
                        continue;
                    }
                    //判断Tag是否在当前区域中
                    if (CommonBoxOperation.JudgeTagArea(tp.Key, StrAreaID))
                    {
                        RtAroundTagPlace.Num         = CommonBoxOperation.GetRouterAroundNum(tp.Value.RD_New[0].ToString("X2") + tp.Value.RD_New[1].ToString("X2"));
                        RtAroundTagPlace.CurImageTag = tp.Value;
                        if (ImageBitmap == null)
                        {
                            continue;
                        }
                        RtAroundTagPlace.DrawTag3_Place(ImageBitmap, scalew, scaleh);
                    }
                }
            }catch (Exception)
            {
            }
            ImagePanel_Paint(null, null);
        }
Esempio n. 2
0
 private void RegInfoWin_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (ImageTimer != null)
     {
         ImageTimer.Stop();
     }
     // 图形模式
     if (ListTimer != null)
     {
         ListTimer.Stop();
     }
     //清除各Tag上次的位置
     if (null == MyArea)
     {
         return;
     }
     RtAroundTagPlace.ClearAreaAllRouterStand(MyArea);
     RtAroundTagPlace.ClearAreaAllTagOldRouter(MyArea);
 }