ImageLocation() private static method

private static ImageLocation ( StringFormat SF, SizeF Area, SizeF ImageArea ) : PointF
SF System.Drawing.StringFormat
Area System.Drawing.SizeF
ImageArea System.Drawing.SizeF
return System.Drawing.PointF
Esempio n. 1
0
        // Token: 0x06000091 RID: 145 RVA: 0x0000EC04 File Offset: 0x0000CE04
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics graphics = e.Graphics;

            graphics.SmoothingMode = SmoothingMode.HighQuality;
            PointF pointF = MonoFlat_Button.ImageLocation(this.GetStringFormat(this.ImageAlign), base.Size, this.ImageSize);

            switch (this.MouseState)
            {
            case 0:
                graphics.FillPath(this.InactiveGB, this.Shape);
                graphics.DrawPath(this.P1, this.Shape);
                if (this.Image == null)
                {
                    graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), this.R1, new StringFormat
                    {
                        Alignment     = this._TextAlignment,
                        LineAlignment = StringAlignment.Center
                    });
                }
                else
                {
                    graphics.DrawImage(this._Image, pointF.X, pointF.Y, (float)this.ImageSize.Width, (float)this.ImageSize.Height);
                    graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), this.R1, new StringFormat
                    {
                        Alignment     = this._TextAlignment,
                        LineAlignment = StringAlignment.Center
                    });
                }
                break;

            case 1:
                graphics.FillPath(this.PressedGB, this.Shape);
                graphics.DrawPath(this.P3, this.Shape);
                if (this.Image == null)
                {
                    graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), this.R1, new StringFormat
                    {
                        Alignment     = this._TextAlignment,
                        LineAlignment = StringAlignment.Center
                    });
                }
                else
                {
                    graphics.DrawImage(this._Image, pointF.X, pointF.Y, (float)this.ImageSize.Width, (float)this.ImageSize.Height);
                    graphics.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), this.R1, new StringFormat
                    {
                        Alignment     = this._TextAlignment,
                        LineAlignment = StringAlignment.Center
                    });
                }
                break;
            }
            base.OnPaint(e);
        }