Eabei.GoBangGame/Eabei.Controls/EabeiChartUnitControl.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


/********************************
*  命名空间: Eabei.Controls
*  
*  功    能: N/A
*  类    名: EabeiChartUnitControl
*  
*  作    者: EB
*  创建日期: 2022/7/1 10:26:29
*********************************/

namespace Eabei.Controls
{
    public class EabeiChartUnitControl : Panel
    {
        public EabeiChartUnitControl()
        {
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            //this.SetStyle(ControlStyles.UserPaint, true);

            this.BackColor = Color.Transparent;
            this.BorderStyle = BorderStyle.None;
            this.Dock = DockStyle.Top;
        }

        private MessageContent? _messageContent;
        [DefaultValue(typeof(MessageContent), null), Description("绘制的消息信息")]
        public MessageContent? MessageInfo { get => _messageContent; set { _messageContent = value; this.Invalidate(false); } }

        private DrawStyle _drawStyle = DrawStyle.Left;
        [DefaultValue(typeof(DrawStyle), "Left"), Description("消息绘制样式位置")]
        public DrawStyle DrawStyle1 { get => _drawStyle; set { _drawStyle = value; this.Invalidate(false); } }


        private Color _titleColor = Color.White;
        [DefaultValue(typeof(Color), "White"), Description("标题颜色")]
        public Color TitleColor { get => _titleColor; set { _titleColor = value; this.Invalidate(false); } }

        private byte _alpha = 0x40;
        [DefaultValue(0x40), Description("背景色的透明通道")]
        public byte Alpha { get => _alpha; set { _alpha = value; this.Invalidate(false); } }

        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(_alpha, 0x4f, 0x58, 0x50)), new Rectangle(0, 0, this.Width - 1, this.Height - 1));
            //绘制消息信息
            if (_messageContent is not null)
            {
                switch (_drawStyle)
后面还有 121 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。