Exemple #1
0
        }                                //中心图片缩放

        public override void ShowTip(ImageToolTip tooltip, Control form, int x, int y)
        {
            var regionType = GetVType();

            if (regionType == PictureRegionCellType.Item)
            {
                Image image = HItemBook.GetPreview(nid);
                tooltip.Show(image, form, x, y);
            }
            else if (regionType == PictureRegionCellType.Gismo)
            {
                Image image = DungeonBook.GetPreview(nid);
                tooltip.Show(image, form, x, y);
            }
            else if (regionType == PictureRegionCellType.People)
            {
                Image image = SamuraiBook.GetPreview(nid);
                tooltip.Show(image, form, x, y);
            }
            else if (regionType == PictureRegionCellType.DungeonItem)
            {
                var   itemConfig = ConfigData.GetDungeonItemConfig(nid);
                Image image      = DrawTool.GetImageByString(itemConfig.Name + "$" + itemConfig.Des, 160);
                tooltip.Show(image, form, x, y);
            }
        }
 public void HideContentTooltip(IDockContent content, ImageToolTip imageToolTip)
 {
     try
     {
         imageToolTip.RemoveAll();
         imageToolTip.Hide(content.DockHandler.Form);
         _lastContent = null;
     }
     catch (Exception ex)
     {
         Trace.TraceError(ex.Message);
     }
 }
 public void ShowThumbnailImage(IDockContent tipContent, Image tipImage, ImageToolTip imageToolTip, int xOffset = 0, int yOffset = 10)
 {
     if (tipImage != null && _lastContent != tipContent &&
         (_lastPosition.X != Cursor.Position.X || _lastPosition.Y != Cursor.Position.Y))
     {
         _lastContent  = tipContent;
         _lastPosition = Cursor.Position;
         int   outputWidth  = (tipImage.Width / 3) < 400 ? 400 : tipImage.Width / 3;
         int   outputHeight = (tipImage.Height / 3) < 300 ? 300 : tipImage.Height / 3;
         Point startPoint   = tipContent.DockHandler.Form.PointToClient(new Point(Cursor.Position.X + xOffset, Cursor.Position.Y + yOffset));
         imageToolTip.ToolTipImage = ScreenCapture.ScaleImage(tipImage, outputWidth, outputHeight);
         //imageToolTip.ToolTipImage = ScreenCapture.ScaleImage(tipImage, 50);
         String txt = tipContent.DockHandler.Form.Text;
         imageToolTip.ToolTipTitle = txt;
         imageToolTip.Show(txt, tipContent.DockHandler.Form, startPoint, imageToolTip.AutoPopDelay);
     }
 }
Exemple #4
0
 private void TooltipChange(ImageToolTip tooltip, bool isOpen, Image img, IWin32Window w, int x, int y)
 {
     if (InvokeRequired)
     {
         TooltipChangeCallback d = TooltipChange;
         Invoke(d, new object[] { tooltip, isOpen, img, w, x, y });
     }
     else
     {
         if (isOpen)
         {
             tooltip.Show(img, w, x, y);
         }
         else
         {
             tooltip.Hide(w);
         }
     }
 }
Exemple #5
0
 public virtual void ShowTip(ImageToolTip tooltip, Control form, int x, int y)
 {
 }
Exemple #6
0
        }                                //中心图片缩放


        public override void ShowTip(ImageToolTip tooltip, Control form, int x, int y)
        {
            var    regionType = GetVType();
            string resStr     = "";

            if (regionType == ImageRegionCellType.Gold)
            {
                resStr = string.Format("黄金:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Lumber)
            {
                resStr = string.Format("木材:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Stone)
            {
                resStr = string.Format("石材:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Mercury)
            {
                resStr = string.Format("水银:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Carbuncle)
            {
                resStr = string.Format("红宝石:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Sulfur)
            {
                resStr = string.Format("硫磺:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Gem)
            {
                resStr = string.Format("水晶:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Food)
            {
                resStr = string.Format("食物:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Health)
            {
                resStr = string.Format("生命:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Mental)
            {
                resStr = string.Format("精神:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Exp)
            {
                resStr = string.Format("经验值:{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Str)
            {
                resStr = string.Format("力量(副本属性)+{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Agi)
            {
                resStr = string.Format("敏捷(副本属性)+{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Intl)
            {
                resStr = string.Format("智慧(副本属性)+{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Perc)
            {
                resStr = string.Format("感知(副本属性)+{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.Endu)
            {
                resStr = string.Format("耐力(副本属性)+{0}", Parm);
            }
            else if (regionType == ImageRegionCellType.BuildEp)
            {
                resStr = string.Format("城堡建筑能量+{0}", Parm);
            }

            tooltip.Show(DrawTool.GetImageByString(resStr, 120), form, x, y);
        }