Point CalcTextPosition(OverlayLayeredWindowObjectInfoArgs drawArgs) { if (!CanDraw) { return(Point.Empty); } Size textSize = drawArgs.Cache.CalcTextSize(Text, font).ToSize(); return(new Point((drawArgs.Bounds.Width - textSize.Width) / 2, drawArgs.ViewInfo.ImageBounds.Bottom + textSize.Height)); }
protected virtual void CalculateLayout(OverlayLayeredWindowObjectInfoArgs drawArgs) { }
protected override void CalculateLayout(OverlayLayeredWindowObjectInfoArgs drawArgs) { this.textPos = CalcTextPosition(drawArgs); }
protected override Rectangle CalcTextBounds(OverlayLayeredWindowObjectInfoArgs drawArgs) { Size textSz = CalcTextSize(drawArgs); return(textSz.AlignWith(drawArgs.Bounds).WithY(drawArgs.ImageBounds.Top - textSz.Height)); }
protected override Rectangle CalcImageBounds(OverlayLayeredWindowObjectInfoArgs drawArgs) { int indent = 10; return(Image.Size.AlignWith(drawArgs.Bounds).WithY(indent).WithX(drawArgs.Bounds.Width - Image.Height - indent)); }
Rectangle CalcButtonRect(OverlayLayeredWindowObjectInfoArgs drawArgs) { Point loc = new Point((drawArgs.Bounds.Width - image.Width) / 2, drawArgs.Bounds.Height - 2 * image.Height); return(new Rectangle(loc, image.Size)); }
protected override void CalculateLayout(OverlayLayeredWindowObjectInfoArgs drawArgs) { this.imageRect = CalcButtonRect(drawArgs); this.mousePos = CalcMousePosition(drawArgs.ViewInfo.Owner); this.currentImage = imageRect.Contains(mousePos) ? hotImage : image; }