C#绘制含流动块的管道

news2024/9/23 19:24:58

1,效果。

2,绘制技巧。

1,流动块的实质是使用Pen的自定义DashStyle绘制的线,并使用线的偏移值呈现出流动的效果。

 Pen barPen = new Pen(BarColor, BarHeight);
                barPen.DashStyle = DashStyle.Custom;
                barPen.DashOffset = startOffset;
                barPen.DashPattern = new float[] { BarLength, GapLength };
                graphicsPath.StartFigure();
                g.DrawPath(barPen, graphicsPath);

2,使用GraphicsPath,绘制包含弧的多段线。

 GraphicsPath graphicsPath = new GraphicsPath();
 //特别需要注意角度旋转方向,如果角度旋转方向选错就形成闭环
graphicsPath.AddArc(new Rectangle(this.Height / 2, this.Height / 2 * (-1) - 1, this.Height, this.Height), 180.0f, -90.0f);

3,对于扇形区域使用渐变色时需要使用PathGradientBrush画刷而不是 LinearGradientBrush, LinearGradientBrush画刷无法实现从圆心到边缘的颜色渐变。

void PaintRectangle(Graphics g, Rectangle rec, PointF[] points, LinearGradientMode linearGradientMode = LinearGradientMode.Vertical)
        {
            //画刷效果呈现线型分布,注意与PathGradientBrush的区别
            LinearGradientBrush brush = new LinearGradientBrush(rec, PipeEdgeColor, PipeCenterColor, linearGradientMode);
            brush.InterpolationColors = new ColorBlend() { Colors = new Color[] { PipeEdgeColor, PipeCenterColor, PipeEdgeColor }, Positions = new float[] { 0, 0.5f, 1 } };
            brush.InterpolationColors = new ColorBlend() { Colors = new Color[] { PipeEdgeColor, PipeCenterColor, PipeEdgeColor }, Positions = new float[] { 0, 0.5f, 1 } };
            g.FillRectangle(brush, rec);
            g.DrawLine(new Pen(BorderColor, BorderWidth), points[0], points[1]);
            g.DrawLine(new Pen(BorderColor, BorderWidth), points[2], points[3]);
        }

3,使用自定义的流动管道控件(FlowControl)

引用控件

属性窗口设置自定义的相关属性

设置后效果

4,代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace CustomControl
{
    public partial class FlowControl : UserControl
    {
        private float startOffset = 0.0f;
        private Timer mytimer = new Timer();
        Graphics g;
        public FlowControl()
        {
            InitializeComponent();
            设置控件样式
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            mytimer.Interval = 50;
            mytimer.Tick += Mytimer_Tick;
            mytimer.Start();
        }
        private void Mytimer_Tick(object sender, EventArgs e)
        {
            startOffset += moveSpeed;
            if (Math.Abs(startOffset) > BarLength + GapLength)
            {
                startOffset = 0;
            }
            this.Invalidate();
        }
        #region Fileds
        private int barHeight = 5;
        [Browsable(true), Category("自定义属性"), Description("流动条宽度")]
        public int BarHeight
        {
            get { return barHeight; }
            set
            {
                this.barHeight = value;
                base.Invalidate();
            }
        }
        private Color barColor = Color.DodgerBlue;
        [Browsable(true), Category("自定义属性"), Description("获取或设置管道控件的流动块颜色")]
        public Color BarColor
        {
            get
            {
                return this.barColor;
            }
            set
            {
                this.barColor = value;
                base.Invalidate();
            }
        }
        private Color borderColor = Color.DimGray;
        [Browsable(true), Category("自定义属性"), Description("获取或设置管道边线颜色")]
        public Color BorderColor
        {
            get
            {
                return this.borderColor;
            }
            set
            {
                this.borderColor = value;
                base.Invalidate();
            }
        }
        private float borderWidth = 1;
        [Browsable(true), Category("自定义属性"), Description("获取或设置管道壁厚度")]
        public float BorderWidth
        {
            get
            {
                return this.borderWidth;
            }
            set
            {
                this.borderWidth = value;
                base.Invalidate();
            }
        }
        private Color pipeEdgeColor = Color.DimGray;
        [Browsable(true), Category("自定义属性"), Description("获取或设置管道边缘颜色")]
        public Color PipeEdgeColor
        {
            get
            {
                return this.pipeEdgeColor;
            }
            set
            {
                this.pipeEdgeColor = value;
                base.Invalidate();
            }
        }
        private Color pipeCenterColor = Color.LightGray;
        [Browsable(true), Category("自定义属性"), Description("获取或设置管道控件的中心颜色")]
        public Color PipeCenterColor
        {
            get
            {
                return this.pipeCenterColor;
            }
            set
            {
                this.pipeCenterColor = value;
                base.Invalidate();
            }
        }
        private PipeTurnDirection pipeTurnLeft = PipeTurnDirection.None;
        [Browsable(true), Category("自定义属性"), Description("左管道的转向类型")]
        public PipeTurnDirection PipeTurnLeft
        {
            get
            {
                return this.pipeTurnLeft;
            }
            set
            {
                this.pipeTurnLeft = value;
                base.Invalidate();
            }
        }
        private PipeTurnDirection pipeTurnRight = PipeTurnDirection.None;
        [Browsable(true), Category("自定义属性"), Description("右管道的转向类型")]
        public PipeTurnDirection PipeTurnRight
        {
            get
            {
                return this.pipeTurnRight;
            }
            set
            {
                this.pipeTurnRight = value;
                base.Invalidate();
            }
        }
        private DirectionStyle pipeLineDirection = DirectionStyle.Horizontal;
        [Browsable(true), Category("自定义属性"), Description("设置管道是横向的还是纵向的")]
        public DirectionStyle PipeLineDirection
        {
            get
            {
                return this.pipeLineDirection;
            }
            set
            {
                this.pipeLineDirection = value;
                int temp;
                if (value == DirectionStyle.Horizontal)
                {
                    temp = Height;
                    Height = Width;
                    Width = temp;
                }
                else
                {
                    temp = Width;
                    Width = Height;
                    Height = temp;
                }
                base.Invalidate();
            }
        }
        private bool isActive = false;
        [Browsable(true), Category("自定义属性"), DefaultValue(false), Description("获取或设置管道线是否激活液体显示")]
        public bool IsActive
        {
            get
            {
                return this.isActive;
            }
            set
            {
                this.isActive = value;
                this.mytimer.Enabled = value;
                base.Invalidate();
            }
        }
        private float moveSpeed = 0.3f;
        [Browsable(true), Category("自定义属性"), Description("管道线液体流动的速度,0为静止,正数为正向流动,负数为反向流动")]
        public float MoveSpeed
        {
            get
            {
                return this.moveSpeed;
            }
            set
            {
                this.moveSpeed = value;
                base.Invalidate();
            }
        }
        private int barLength = 5;
        [Browsable(true), Category("自定义属性"), Description("流动条长度")]
        public int BarLength
        {
            get
            {
                return this.barLength;
            }
            set
            {
                this.barLength = value;
                base.Invalidate();
            }
        }
        private int gapLength = 5;
        [Browsable(true), Category("自定义属性"), Description("间隙长度")]
        public int GapLength
        {
            get
            {
                return this.gapLength;
            }
            set
            {
                this.gapLength = value;
                base.Invalidate();
            }
        }
        #endregion
        protected override void OnResize(EventArgs e)
        {
            if (PipeLineDirection == DirectionStyle.Horizontal)
            {
                if (Width < 2 * Height)
                {
                    Width = 2 * Height;
                }
            }
            else
            {
                if (Height < 2 * Width)
                {
                    Height = 2 * Width;
                }
            }
            base.OnResize(e);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            //  base.OnPaint(e);
            g = e.Graphics;
            Rectangle rec;
            Rectangle rec2;
            GraphicsPath graphicsPath = new GraphicsPath();
            if (PipeLineDirection == DirectionStyle.Horizontal)
            {
                #region 水平
                switch (pipeTurnLeft)
                {
                    case PipeTurnDirection.Up:
                        rec = new Rectangle(0, -Height, 2 * Height, 2 * Height);
                        rec2 = new Rectangle(rec.X + (int)BorderWidth / 2, rec.Y, rec.Width - (int)BorderWidth, rec.Height - (int)BorderWidth / 2);
                        PaintElliple(g, rec, rec2, 90, 90);
                        // path.AddArc(new Rectangle( Height / 2, rec.Y /2, Height , Height), 90, 90);
                        //特别需要注意角度旋转方向,如果角度旋转方向选错就形成闭环
                        graphicsPath.AddArc(new Rectangle(this.Height / 2, this.Height / 2 * (-1) - 1, this.Height, this.Height), 180.0f, -90.0f);
                        break;
                    case PipeTurnDirection.Down:
                        rec = new Rectangle(0, 0, 2 * Height, 2 * Height);
                        rec2 = new Rectangle(rec.X + (int)BorderWidth / 2, rec.Y + (int)BorderWidth / 2, rec.Width - (int)BorderWidth, rec.Height - (int)BorderWidth / 2);
                        PaintElliple(g, rec, rec2, 180, 90);
                        graphicsPath.AddArc(new Rectangle(Height / 2, Height / 2, Height, Height), 180, 90);
                        break;
                    case PipeTurnDirection.Left:
                    case PipeTurnDirection.Right:
                    case PipeTurnDirection.None:
                        PointF[] points = new PointF[] { new PointF(Height, BorderWidth / 2), new PointF(0, BorderWidth / 2), new PointF(0, Height - BorderWidth / 2), new PointF(Height, Height - BorderWidth / 2) };
                        PaintRectangle(g, new Rectangle(0, 0, Height, Height), points);
                        graphicsPath.AddLine(new PointF(0, Height / 2), new PointF(Height, Height / 2));
                        break;
                    default:
                        break;
                }
                switch (PipeTurnRight)
                {
                    case PipeTurnDirection.Up:
                        rec = new Rectangle(Width - 2 * Height, -Height, 2 * Height, 2 * Height);
                        rec2 = new Rectangle(rec.X + (int)BorderWidth / 2, rec.Y, rec.Width - (int)BorderWidth, rec.Height - (int)BorderWidth / 2);
                        PaintElliple(g, rec, rec2, 0, 90);
                        graphicsPath.AddArc(new Rectangle(rec.X + Height / 2, rec.Y / 2, Height, Height), 90, -90);
                        break;
                    case PipeTurnDirection.Down:
                        rec = new Rectangle(Width - 2 * Height, 0, 2 * Height, 2 * Height);
                        rec2 = new Rectangle(rec.X, rec.Y + (int)BorderWidth / 2, rec.Width - (int)BorderWidth / 2, rec.Height - (int)BorderWidth / 2);
                        PaintElliple(g, rec, rec2, 270, 90);
                        //特别需要注意角度旋转方向,如果角度旋转方向选错就形成闭环
                        graphicsPath.AddArc(new Rectangle(rec.X + Height / 2, Height / 2, Height, Height), 270, 90);
                        break;
                    case PipeTurnDirection.Left:
                    case PipeTurnDirection.Right:
                    case PipeTurnDirection.None:
                        PointF[] points = new PointF[] { new PointF(Width - Height, BorderWidth / 2), new PointF(Width, BorderWidth / 2), new PointF(Width, Height - BorderWidth / 2), new PointF(Width - Height, Height - BorderWidth / 2) };
                        PaintRectangle(g, new Rectangle(Width - Height, 0, Height, Height), points);
                        graphicsPath.AddLine(Width - Height, Height / 2, Width, Height / 2);
                        break;
                    default:
                        break;
                }
                if (Width > Height * 2)
                {
                    PointF[] points = new PointF[] { new PointF(Height, BorderWidth / 2), new PointF(Width - Height, BorderWidth / 2), new PointF(Height, Height - BorderWidth / 2), new PointF(Width - Height, Height - BorderWidth / 2) };
                    PaintRectangle(g, new Rectangle(Height, 0, Width - 2 * Height, Height), points);
                    //  graphicsPath.AddLine(Height, Height / 2,Width- Height , Height / 2);
                }
                #endregion
            }
            else
            {
                //垂直
                switch (pipeTurnLeft)
                {
                    case PipeTurnDirection.Left:
                        rec = new Rectangle(-Width, 0, 2 * Width, 2 * Width);
                        rec2 = new Rectangle(rec.X, rec.Y + (int)BorderWidth / 2, rec.Width - (int)BorderWidth / 2, rec.Height - (int)BorderWidth);
                        PaintElliple(g, rec, rec2, 270, 90);
                        // path.AddArc(new Rectangle( Height / 2, rec.Y /2, Height , Height), 90, 90);
                        //特别需要注意角度旋转方向,如果角度旋转方向选错就形成闭环
                        graphicsPath.AddArc(new Rectangle(-this.Width / 2, this.Width / 2, this.Width, this.Width), 270.0f, 90.0f);
                        break;
                    case PipeTurnDirection.Right:
                        rec = new Rectangle(0, 0, 2 * Width, 2 * Width);
                        rec2 = new Rectangle(rec.X + (int)BorderWidth / 2, rec.Y + (int)BorderWidth / 2, rec.Width - (int)BorderWidth, rec.Height - (int)BorderWidth / 2);
                        PaintElliple(g, rec, rec2, 180, 90);
                        graphicsPath.AddArc(new Rectangle(Width / 2, Width / 2, Width, Width), 180, 90);
                        break;
                    case PipeTurnDirection.Up:
                    case PipeTurnDirection.Down:
                    case PipeTurnDirection.None:
                        PointF[] points = new PointF[] { new PointF(BorderWidth / 2, 0), new PointF(BorderWidth / 2, Width), new PointF(Width - BorderWidth / 2, 0), new PointF(Width - BorderWidth / 2, Width) };
                        PaintRectangle(g, new Rectangle(0, 0, Width, Width), points, LinearGradientMode.Horizontal);
                        graphicsPath.AddLine(new PointF(Width / 2, 0), new PointF(Width / 2, Width));
                        break;
                    default:
                        break;
                }
                switch (PipeTurnRight)
                {
                    case PipeTurnDirection.Left:
                        rec = new Rectangle(-Width, Height - 2 * Width, 2 * Width, 2 * Width);
                        rec2 = new Rectangle(rec.X, rec.Y + (int)BorderWidth / 2, rec.Width - (int)BorderWidth / 2, rec.Height - (int)BorderWidth);
                        PaintElliple(g, rec, rec2, 0, 90);
                        //特别需要注意角度旋转方向,如果角度旋转方向选错就形成闭环
                        graphicsPath.AddArc(new Rectangle(rec.X / 2, rec.Y + Width / 2, this.Width, this.Width), 0f, 90.0f);
                        break;
                    case PipeTurnDirection.Right:
                        rec = new Rectangle(0, Height - 2 * Width, 2 * Width, 2 * Width);
                        rec2 = new Rectangle(rec.X + (int)BorderWidth / 2, rec.Y + 1, rec.Width - (int)BorderWidth, rec.Height - (int)BorderWidth / 2);
                        PaintElliple(g, rec, rec2, 90, 90);
                        graphicsPath.AddArc(new Rectangle(Width / 2, rec.Y + Width / 2, Width, Width), 180, -90);
                        break;
                    case PipeTurnDirection.Up:
                    case PipeTurnDirection.Down:
                    case PipeTurnDirection.None:
                        PointF[] points = new PointF[] { new PointF(BorderWidth / 2, Height - Width), new PointF(BorderWidth / 2, Height), new PointF(Width - BorderWidth / 2, Height - Width), new PointF(Width - BorderWidth / 2, Height) };
                        PaintRectangle(g, new Rectangle(0, Height - Width, Width, Width), points, LinearGradientMode.Horizontal);
                        graphicsPath.AddLine(new PointF(Width / 2, Height - Width), new PointF(Width / 2, Height));
                        break;
                    default:
                        break;
                }
                if (Height > Width * 2)
                {
                    PointF[] points = new PointF[] { new PointF(BorderWidth / 2, Width), new PointF(BorderWidth / 2, Height - Width), new PointF(Width - BorderWidth / 2, Width), new PointF(Width - BorderWidth / 2, Height - Width) };
                    PaintRectangle(g, new Rectangle(0, Width, Width, Height - 2 * Width), points, LinearGradientMode.Horizontal);
                    // graphicsPath.AddLine(Height, Height / 2,Width- Height , Height / 2);
                }
            }
            if (IsActive)
            {
                //绘制流动条
                Pen barPen = new Pen(BarColor, BarHeight);
                barPen.DashStyle = DashStyle.Custom;
                barPen.DashOffset = startOffset;
                barPen.DashPattern = new float[] { BarLength, GapLength };
                graphicsPath.StartFigure();
                g.DrawPath(barPen, graphicsPath);
            }
        }
        //绘制椭圆与圆弧
        void PaintElliple(Graphics g, Rectangle rec, Rectangle recArc, float startAngle, float sweepAngle)
        {
            GraphicsPath graphicsPath = new GraphicsPath();
            graphicsPath.AddEllipse(rec);
            //画刷效果呈现由中心向四方层叠     
            PathGradientBrush brush = new PathGradientBrush(graphicsPath);
            brush.CenterPoint = new PointF(rec.X + rec.Width / 2, rec.Y + rec.Height / 2);
            brush.InterpolationColors = new ColorBlend() { Colors = new Color[] { PipeEdgeColor, PipeCenterColor, PipeEdgeColor }, Positions = new float[] { 0, 0.5f, 1 } };
            g.FillPie(brush, rec, startAngle, sweepAngle);
            g.DrawArc(new Pen(BorderColor, BorderWidth), recArc, startAngle, sweepAngle);
        }
        void PaintRectangle(Graphics g, Rectangle rec, PointF[] points, LinearGradientMode linearGradientMode = LinearGradientMode.Vertical)
        {
            //画刷效果呈现线型分布,注意与PathGradientBrush的区别
            LinearGradientBrush brush = new LinearGradientBrush(rec, PipeEdgeColor, PipeCenterColor, linearGradientMode);
            brush.InterpolationColors = new ColorBlend() { Colors = new Color[] { PipeEdgeColor, PipeCenterColor, PipeEdgeColor }, Positions = new float[] { 0, 0.5f, 1 } };
            brush.InterpolationColors = new ColorBlend() { Colors = new Color[] { PipeEdgeColor, PipeCenterColor, PipeEdgeColor }, Positions = new float[] { 0, 0.5f, 1 } };
            g.FillRectangle(brush, rec);
            g.DrawLine(new Pen(BorderColor, BorderWidth), points[0], points[1]);
            g.DrawLine(new Pen(BorderColor, BorderWidth), points[2], points[3]);
        }
    }
    /// <summary>
    /// 管道左、右的转向类型
    /// </summary>
    public enum PipeTurnDirection
    {
        Up = 1,
        Down,
        Left,
        Right,
        None
    }
    /// <summary>
    /// 管道的样式,水平还是数值
    /// </summary>
    public enum DirectionStyle
    {
        Horizontal = 1,
        Vertical
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1929767.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

解读InnoDB数据库索引页与数据行的紧密关联

目录 一、快速走进索引页结构 &#xff08;一&#xff09;整体展示说明 &#xff08;二&#xff09;内容说明 File Header&#xff08;文件头部&#xff09; Page Header&#xff08;页面头部&#xff09; Infimum Supremum&#xff08;最小记录和最大记录&#xff09; …

太速科技-FMC207-基于FMC 两路QSFP+光纤收发子卡

FMC207-基于FMC 两路QSFP光纤收发子卡 一、板卡概述 本卡是一个FPGA夹层卡&#xff08;FMC&#xff09;模块&#xff0c;可提供高达2个QSFP / QSFP 模块接口&#xff0c;直接插入千兆位级收发器&#xff08;MGT&#xff09;的赛灵思FPGA。支持利用Spartan-6、Virtex-6、Kin…

Webpack看这篇就够了

&#x1f49d;&#x1f49d;&#x1f49d;欢迎来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里可以感受到一份轻松愉快的氛围&#xff0c;不仅可以获得有趣的内容和知识&#xff0c;也可以畅所欲言、分享您的想法和见解。 非常期待和您一起在这个小…

java.sql.SQLException: Unknown system variable ‘query_cache_size‘【Pyspark】

1、问题描述 学习SparkSql中&#xff0c;将spark中dataframe数据结构保存为jdbc的格式并提交到本地的mysql中&#xff0c;相关代码见文章末尾。 运行代码时报出相关配置文件错误&#xff0c;如下。 根据该报错&#xff0c;发现网络上多数解决方都是基于java开发的解决方案&a…

GPT-4从0到1搭建一个Agent简介

GPT-4从0到1搭建一个Agent简介 1. 引言 在人工智能领域&#xff0c;Agent是一种能够感知环境并采取行动以实现特定目标的系统。本文将简单介绍如何基于GPT-4搭建一个Agent。 2. Agent的基本原理 Agent的核心是感知-行动循环&#xff08;Perception-Action Loop&#xff09;…

【Windows】系统盘空间不足?WizTree 和 DISM++ 来帮忙

当您的系统盘空间接近饱和时&#xff0c;了解硬盘空间的使用情况变得尤为重要。在这种情况下&#xff0c;您可以利用 Windows 内置的存储使用工具来快速查看哪些文件和应用程序占用了大量空间&#xff0c;并采取相应措施进行清理。此外&#xff0c;第三方工具如 WizTree 可以提…

Java NIO合并多个文件

NIO API java.nio (Java Platform SE 8 ) 直接上代码 package com.phil.aoplog.util;import lombok.extern.slf4j.Slf4j;import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel;Slf4j public…

勒索防御第一关 亚信安全AE防毒墙全面升级 勒索检出率提升150%

亚信安全信舷AE高性能防毒墙完成能力升级&#xff0c;全面完善勒索边界“全生命周期”防御体系&#xff0c;筑造边界勒索防御第一关&#xff01; 勒索之殇&#xff0c;银狐当先 当前勒索病毒卷携着AI技术&#xff0c;融合“数字化”的运营模式&#xff0c;形成了肆虐全球的网…

数据结构进阶:使用链表实现栈和队列详解与示例(C, C#, C++)

文章目录 1、 栈与队列简介栈&#xff08;Stack&#xff09;队列&#xff08;Queue&#xff09; 2、使用链表实现栈C语言实现C#语言实现C语言实现 3、使用链表实现队列C语言实现C#语言实现C语言实现 4、链表实现栈和队列的性能分析时间复杂度空间复杂度性能特点与其他实现的比较…

VBA学习(21):遍历文件夹(和子文件夹)中的文件

很多时候&#xff0c;我们都想要遍历文件夹中的每个文件&#xff0c;例如在工作表中列出所有文件名、对每个文件进行修改。VBA给我们提供了一些方式&#xff1a;&#xff08;1&#xff09;Dir函数&#xff1b;&#xff08;2&#xff09;File System Object。 使用Dir函数 Dir…

31.RAM-IP核的配置、调用、仿真全流程

&#xff08;1&#xff09;RAM IP核简介 RAM是随机存取存储器&#xff08;Random Access Memory&#xff09;的简称&#xff0c;是一个易失性存储器&#xff0c;其工作时可以随时对任何一个指定地址写入或读出数据。&#xff08;掉电数据丢失&#xff09; &#xff08;2&#…

Spring Cloud Gateway 入门与实战

一、网关 在微服务框架中&#xff0c;网关是一个提供统一访问地址的组件&#xff0c;它充当了客户端和内部微服务之间的中介。网关主要负责流量路由和转发&#xff0c;将外部请求引导到相应的微服务实例上&#xff0c;同时提供一些功能&#xff0c;如身份认证、授权、限流、监…

【企业级监控】Zabbix监控MySQL主从复制

Zabbix自定义监控项与触发器 文章目录 Zabbix自定义监控项与触发器资源列表基础环境前言四、监控MySQL主从复制4.1、部署mysql主从复制4.1.1、在两台主机&#xff08;102和103上安装&#xff09;4.1.2、主机102当master4.1.3、主机103当slave 4.2、MySQL-slave端开启自定义Key值…

JMeter案例分享:通过数据验证的错误,说说CSV数据文件设置中的线程共享模式

前言 用过JMeter参数化的小伙伴&#xff0c;想必对CSV Data Set Config非常熟悉。大家平时更关注变量名称&#xff0c;是否忽略首行等参数&#xff0c;其余的一般都使用默认值。然而我最近遇到一个未按照我的预想读取数据的案例&#xff0c;原因就出在最后一个参数“线程共享模…

摄像头 RN6752v1 视频采集卡

摄像头 AHD倒车摄像头比较好&#xff0c;AHD英文全名Analog High Definition&#xff0c;即模拟高清&#xff0c;拥有比较好的分辨率与画面质感。 RN6752v1 GQW AKKY2 usb 采集卡 FHD&#xff08;1080p&#xff09;、HD&#xff08;720p&#xff09;和D1&#xff08;480i&am…

开始Linux之路

人生得一知己足矣&#xff0c;斯世当以同怀视之。——鲁迅 Linux操作系统简单操作指令 1、ls指令2、pwd命令3、cd指令4、mkdir指令(重要)5、whoami命令6、创建一个普通用户7、重新认识指令8、which指令9、alias命令10、touch指令11、rmdir指令 及 rm指令(重要)12、man指令(重要…

C# Winform的三态CheckBox,以及批量修改Panel中的控件

在C# WinForms中&#xff0c;如果你想批量修改一个Panel容器内的所有CheckBox控件的状态&#xff0c;你可以使用foreach循环来遍历Panel的Controls集合。下面是一个示例&#xff0c;展示了如何将一个Panel内所有的CheckBox控件设为选中状态&#xff08;Checked true&#xff0…

借助 Aspose.Words,在 C# 中将 Word 转换为 JPG

有时我们需要将 Word 文档转换为图片&#xff0c;因为 DOC 或 DOCX 文件在不同设备上的显示可能会有所不同&#xff0c;但图像&#xff08;例如 JPG 格式&#xff09;在任何地方看起来都一样。 Aspose.Words 是一种高级Word文档处理API&#xff0c;用于执行各种文档管理和操作…

超声波眼镜清洗机哪个牌子好?2024年超全热门眼镜清洗机推荐

夏天来了&#xff0c;在户外活动不到几分钟就已经大汗淋漓&#xff01;特别是汗珠一滴滴的挂在眼皮上往下坠落简直让戴眼镜的人苦不堪言&#xff01;虽说戴眼镜在现如今来看是非常普遍的一件事情&#xff0c;但是人们一直深受眼镜清洗的困扰&#xff01;很多朋友看到这里可能会…

C++学习日记 | Lecture 9 类基础

资料来源&#xff1a;南科大 余仕琪 C/C Program Design LINK&#xff1a; CPP/week09 at main ShiqiYu/CPP GitHub9.1-classes-and-objects_哔哩哔哩_bilibili9.2-constructors-and-destructors_哔哩哔哩_bilibili9.3-this-pointer_哔哩哔哩_bilibili9.4-const-and-static…