C#语言实例源码系列-实现无损压缩图片

news2025/1/10 16:03:50
专栏分享
  • 点击跳转=>Unity3D特效百例
  • 点击跳转=>案例项目实战源码
  • 点击跳转=>游戏脚本-辅助自动化
  • 点击跳转=>Android控件全解手册

👉关于作者

众所周知,人生是一个漫长的流程,不断克服困难,不断反思前进的过程。在这个过程中会产生很多对于人生的质疑和思考,于是我决定将自己的思考,经验和故事全部分享出来,以此寻找共鸣 !!!
专注于Android/Unity和各种游戏开发技巧,以及各种资源分享(网站、工具、素材、源码、游戏等)
有什么需要欢迎私我,交流群让学习不再孤单

在这里插入图片描述

👉实践过程

😜效果

在这里插入图片描述

😜代码

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    FileSystemInfo[] fsi = null;
    string ImgPath = "";
    ArrayList al = new ArrayList();
    string ImgSavePath = "";
    string strSourcePath = "";
    Thread td;
    Image ig = null;
    string strSavePath = "";

    private void Form1_Load(object sender, EventArgs e)
    {
        CheckForIllegalCrossThreadCalls = false;
    }

    /// <summary>
    /// 无损图片缩放
    /// </summary>
    /// <param name="sFile">图片的原始路径</param>
    /// <param name="dFile">缩放后图片的保存路径</param>
    /// <param name="dHeight">缩放后图片的高度</param>
    /// <param name="dWidth">缩放后图片的宽度</param>
    /// <returns></returns>
    public static bool GetPicThumbnail(string sFile, string dFile, int dHeight, int dWidth)
    {
        Image iSource = Image.FromFile(sFile);
        ImageFormat tFormat = iSource.RawFormat;
        int sW = 0, sH = 0;
        // 按比例缩放
        Size tem_size = new Size(iSource.Width, iSource.Height);
        if (tem_size.Height > dHeight || tem_size.Width > dWidth)
        {
            if ((tem_size.Width * dHeight) > (tem_size.Height * dWidth))
            {
                sW = dWidth;
                sH = (dWidth * tem_size.Height) / tem_size.Width;
            }
            else
            {
                sH = dHeight;
                sW = (tem_size.Width * dHeight) / tem_size.Height;
            }
        }
        else
        {
            sW = tem_size.Width;
            sH = tem_size.Height;
        }

        Bitmap oB = new Bitmap(dWidth, dHeight);
        Graphics g = Graphics.FromImage(oB);
        g.Clear(Color.WhiteSmoke);
        // 设置画布的描绘质量
        g.CompositingQuality = CompositingQuality.HighQuality;
        g.SmoothingMode = SmoothingMode.HighQuality;
        g.InterpolationMode = InterpolationMode.HighQualityBicubic;
        g.DrawImage(iSource, new Rectangle((dWidth - sW) / 2, (dHeight - sH) / 2, sW, sH), 0, 0, iSource.Width, iSource.Height, GraphicsUnit.Pixel);
        g.Dispose();
        // 以下代码为保存图片时,设置压缩质量
        EncoderParameters eP = new EncoderParameters();
        long[] qy = new long[1];
        qy[0] = 100;
        EncoderParameter eParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, qy);
        eP.Param[0] = eParam;
        try
        {
            //获得包含有关内置图像编码解码器的信息的ImageCodecInfo对象。
            ImageCodecInfo[] arrayICI = ImageCodecInfo.GetImageEncoders();
            ImageCodecInfo jpegICIinfo = null;
            for (int x = 0; x < arrayICI.Length; x++)
            {
                if (arrayICI[x].FormatDescription.Equals("JPEG"))
                {
                    jpegICIinfo = arrayICI[x]; //设置JPEG编码
                    break;
                }
            }

            if (jpegICIinfo != null)
            {
                oB.Save(dFile, jpegICIinfo, eP);
            }
            else
            {
                oB.Save(dFile, tFormat);
            }

            return true;
        }
        catch
        {
            return false;
        }
        finally
        {
            iSource.Dispose();
            oB.Dispose();
        }
    }

    private void pictureBox1_Click(object sender, EventArgs e)
    {
        if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
        {
            fsi = null;
            al.Clear();
            txtPicPath.Text = folderBrowserDialog1.SelectedPath;
            ImgPath = txtPicPath.Text.Trim();
            DirectoryInfo di = new DirectoryInfo(txtPicPath.Text);
            fsi = di.GetFileSystemInfos();
            for (int i = 0; i < fsi.Length; i++)
            {
                string ofile = fsi[i].ToString();
                string fileType = ofile.Substring(ofile.LastIndexOf(".") + 1, ofile.Length - ofile.LastIndexOf(".") - 1);
                fileType = fileType.ToLower();
                if (fileType == "jpeg" || fileType == "jpg" || fileType == "bmp" || fileType == "png")
                {
                    al.Add(ofile);
                }
            }

            lblPicNum.Text = al.Count.ToString();
        }
    }

    private void pictureBox2_Click(object sender, EventArgs e)
    {
        if (folderBrowserDialog2.ShowDialog() == DialogResult.OK)
        {
            txtSavePath.Text = folderBrowserDialog2.SelectedPath;
            ImgSavePath = txtSavePath.Text.Trim();
        }
    }

    private void button2_Click(object sender, EventArgs e)
    {
        Application.Exit();
    }

    private void rbPercent_Enter(object sender, EventArgs e)
    {
        groupBox1.Focus();
    }

    private void rbResolving_Enter(object sender, EventArgs e)
    {
        groupBox1.Focus();
    }

    private void CompleteIMG()
    {
        progressBar1.Maximum = al.Count;
        progressBar1.Minimum = 1;
        if (ImgPath.Length == 3)
            strSourcePath = ImgPath;
        else
            strSourcePath = ImgPath + "\\";

        if (ImgSavePath.Length == 3)
            strSavePath = ImgSavePath;
        else
            strSavePath = ImgSavePath + "\\";
        for (int i = 0; i < al.Count; i++)
        {
            ig = Image.FromFile(strSourcePath + al[i].ToString());
            if (rbPercent.Checked)
            {
                GetPicThumbnail(strSourcePath + al[i].ToString(), strSavePath + al[i].ToString(), Convert.ToInt32(ig.Width * (numericUpDown1.Value / 100)),
                    Convert.ToInt32(ig.Height * (numericUpDown1.Value / 100)));
            }

            ig.Dispose();
            progressBar1.Value = i + 1;
            lblComplete.Text = Convert.ToString(i + 1);
        }

        if (lblComplete.Text == al.Count.ToString())
        {
            MessageBox.Show("压缩成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            progressBar1.Value = 1;
            pictureBox1.Enabled = true;
            pictureBox2.Enabled = true;
            rbPercent.Enabled = true;
            lblPicNum.Text = "0";
            lblComplete.Text = "0";
        }
    }

    private void button1_Click(object sender, EventArgs e)
    {
        if (txtPicPath.Text.Trim() != "" && txtSavePath.Text.Trim() != "" && lblPicNum.Text != "0")
        {
            pictureBox1.Enabled = false;
            pictureBox2.Enabled = false;
            rbPercent.Enabled = false;
            td = new Thread(new ThreadStart(this.CompleteIMG));
            td.Start();
        }
        else
        {
            if (txtPicPath.Text.Trim() == "" && txtSavePath.Text.Trim() == "")
            {
                MessageBox.Show("警告:请选择待处理的图片目录及保存位置", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (txtPicPath.Text.Trim() == "")
                    MessageBox.Show("警告:请选择待处理的图片", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                if (txtSavePath.Text.Trim() == "")
                    MessageBox.Show("警告:请选择保存路径", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }

    private void Form1_FormClosed(object sender, FormClosedEventArgs e)
    {
        if (td != null)
        {
            td.Abort();
        }
    }
}
 partial class Form1
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.panel2 = new System.Windows.Forms.Panel();
            this.pictureBox2 = new System.Windows.Forms.PictureBox();
            this.txtSavePath = new System.Windows.Forms.TextBox();
            this.panel1 = new System.Windows.Forms.Panel();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.txtPicPath = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.rbPercent = new System.Windows.Forms.RadioButton();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.progressBar1 = new System.Windows.Forms.ProgressBar();
            this.label13 = new System.Windows.Forms.Label();
            this.lblComplete = new System.Windows.Forms.Label();
            this.lblPicNum = new System.Windows.Forms.Label();
            this.label8 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
            this.folderBrowserDialog2 = new System.Windows.Forms.FolderBrowserDialog();
            this.groupBox1.SuspendLayout();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.groupBox2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
            this.groupBox3.SuspendLayout();
            this.SuspendLayout();
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.panel2);
            this.groupBox1.Controls.Add(this.panel1);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Location = new System.Drawing.Point(3, 1);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(458, 81);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "常规";
            // 
            // panel2
            // 
            this.panel2.BackColor = System.Drawing.Color.White;
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel2.Controls.Add(this.pictureBox2);
            this.panel2.Controls.Add(this.txtSavePath);
            this.panel2.Location = new System.Drawing.Point(130, 53);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(322, 21);
            this.panel2.TabIndex = 5;
            // 
            // pictureBox2
            // 
            this.pictureBox2.Cursor = System.Windows.Forms.Cursors.PanSE;
            this.pictureBox2.Image = global::CompressImg.Properties.Resources.文件夹打开;
            this.pictureBox2.Location = new System.Drawing.Point(300, 0);
            this.pictureBox2.Name = "pictureBox2";
            this.pictureBox2.Size = new System.Drawing.Size(19, 18);
            this.pictureBox2.TabIndex = 8;
            this.pictureBox2.TabStop = false;
            this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
            // 
            // txtSavePath
            // 
            this.txtSavePath.BackColor = System.Drawing.Color.White;
            this.txtSavePath.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtSavePath.Location = new System.Drawing.Point(0, 1);
            this.txtSavePath.Name = "txtSavePath";
            this.txtSavePath.ReadOnly = true;
            this.txtSavePath.Size = new System.Drawing.Size(302, 14);
            this.txtSavePath.TabIndex = 1;
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel1.Controls.Add(this.pictureBox1);
            this.panel1.Controls.Add(this.txtPicPath);
            this.panel1.Location = new System.Drawing.Point(130, 23);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(322, 21);
            this.panel1.TabIndex = 4;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Cursor = System.Windows.Forms.Cursors.PanSE;
            this.pictureBox1.Image = global::CompressImg.Properties.Resources.文件夹打开;
            this.pictureBox1.Location = new System.Drawing.Point(300, 0);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(19, 18);
            this.pictureBox1.TabIndex = 8;
            this.pictureBox1.TabStop = false;
            this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
            // 
            // txtPicPath
            // 
            this.txtPicPath.BackColor = System.Drawing.Color.White;
            this.txtPicPath.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtPicPath.Location = new System.Drawing.Point(0, 1);
            this.txtPicPath.Name = "txtPicPath";
            this.txtPicPath.ReadOnly = true;
            this.txtPicPath.Size = new System.Drawing.Size(302, 14);
            this.txtPicPath.TabIndex = 1;
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(7, 57);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(125, 12);
            this.label2.TabIndex = 2;
            this.label2.Text = "处理后的图片保存至:";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(8, 28);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(125, 12);
            this.label1.TabIndex = 0;
            this.label1.Text = "等待处理的图片位置:";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.numericUpDown1);
            this.groupBox2.Controls.Add(this.label4);
            this.groupBox2.Controls.Add(this.label3);
            this.groupBox2.Controls.Add(this.rbPercent);
            this.groupBox2.Location = new System.Drawing.Point(3, 86);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(458, 47);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "改变大小";
            // 
            // numericUpDown1
            // 
            this.numericUpDown1.Location = new System.Drawing.Point(188, 17);
            this.numericUpDown1.Maximum = new decimal(new int[] {
            200,
            0,
            0,
            0});
            this.numericUpDown1.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.numericUpDown1.Name = "numericUpDown1";
            this.numericUpDown1.Size = new System.Drawing.Size(40, 21);
            this.numericUpDown1.TabIndex = 8;
            this.numericUpDown1.Value = new decimal(new int[] {
            50,
            0,
            0,
            0});
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(234, 22);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(11, 12);
            this.label4.TabIndex = 4;
            this.label4.Text = "%";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(92, 22);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(89, 12);
            this.label3.TabIndex = 2;
            this.label3.Text = "改成原图大小的";
            // 
            // rbPercent
            // 
            this.rbPercent.AutoSize = true;
            this.rbPercent.Checked = true;
            this.rbPercent.Location = new System.Drawing.Point(10, 20);
            this.rbPercent.Name = "rbPercent";
            this.rbPercent.Size = new System.Drawing.Size(71, 16);
            this.rbPercent.TabIndex = 0;
            this.rbPercent.TabStop = true;
            this.rbPercent.Text = "按百分比";
            this.rbPercent.UseVisualStyleBackColor = true;
            this.rbPercent.Enter += new System.EventHandler(this.rbPercent_Enter);
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.progressBar1);
            this.groupBox3.Controls.Add(this.label13);
            this.groupBox3.Controls.Add(this.lblComplete);
            this.groupBox3.Controls.Add(this.lblPicNum);
            this.groupBox3.Controls.Add(this.label8);
            this.groupBox3.Controls.Add(this.label7);
            this.groupBox3.Location = new System.Drawing.Point(3, 139);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(458, 85);
            this.groupBox3.TabIndex = 9;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "操作显示";
            // 
            // progressBar1
            // 
            this.progressBar1.Location = new System.Drawing.Point(107, 54);
            this.progressBar1.Name = "progressBar1";
            this.progressBar1.Size = new System.Drawing.Size(302, 18);
            this.progressBar1.Step = 1;
            this.progressBar1.TabIndex = 16;
            // 
            // label13
            // 
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(42, 57);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(53, 12);
            this.label13.TabIndex = 15;
            this.label13.Text = "处理进度";
            // 
            // lblComplete
            // 
            this.lblComplete.AutoSize = true;
            this.lblComplete.Location = new System.Drawing.Point(339, 25);
            this.lblComplete.Name = "lblComplete";
            this.lblComplete.Size = new System.Drawing.Size(11, 12);
            this.lblComplete.TabIndex = 12;
            this.lblComplete.Text = "0";
            // 
            // lblPicNum
            // 
            this.lblPicNum.AutoSize = true;
            this.lblPicNum.Location = new System.Drawing.Point(149, 26);
            this.lblPicNum.Name = "lblPicNum";
            this.lblPicNum.Size = new System.Drawing.Size(11, 12);
            this.lblPicNum.TabIndex = 11;
            this.lblPicNum.Text = "0";
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(255, 26);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(77, 12);
            this.label8.TabIndex = 10;
            this.label8.Text = "已经处理成功";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(42, 26);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(101, 12);
            this.label7.TabIndex = 9;
            this.label7.Text = "待处理的图片共有";
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(305, 230);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 10;
            this.button1.Text = "开始压缩";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // button2
            // 
            this.button2.Location = new System.Drawing.Point(386, 230);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 11;
            this.button2.Text = "取消";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(463, 261);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "无损压缩图片";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.TextBox txtPicPath;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.RadioButton rbPercent;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label lblComplete;
        private System.Windows.Forms.Label lblPicNum;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.PictureBox pictureBox2;
        private System.Windows.Forms.TextBox txtSavePath;
        private System.Windows.Forms.ProgressBar progressBar1;
        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog2;
        private System.Windows.Forms.NumericUpDown numericUpDown1;
    }

需要的再直接Call我,直接发。

👉其他

📢作者:小空和小芝中的小空
📢转载说明-务必注明来源:https://zhima.blog.csdn.net/
📢这位道友请留步☁️,我观你气度不凡,谈吐间隐隐有王者霸气💚,日后定有一番大作为📝!!!旁边有点赞👍收藏🌟今日传你,点了吧,未来你成功☀️,我分文不取,若不成功⚡️,也好回来找我。

温馨提示点击下方卡片获取更多意想不到的资源。
空名先生

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

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

相关文章

微电网两阶段鲁棒优化问题(Matlab代码实现)

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…

Redis之相关介绍、远程docker部署以及相关shell命令

Redis相关shell命令一、概述1、介绍2、作用3、特性4、官方网址二、远程服务Docker上Redis相关测试及命令1、Redis安装及挂载1.1 查找所有关于Redis1.2 拉取最高版本的Redis1.3 通过xftp连接到远程服务器1.4 挂载1.5 开启远程服务器的端口1.6 修改配置文件2、开始使用Redis2.1 开…

autoconf-archive源码安装

0. 源码地址 autoconf-archive源码下载地址经由https://savannah.gnu.org搜索"autoconf-archive"到GNU Autoconf Archive - Summary [Savannah] 再在其中点击上图中箭头位置&#xff0c;转到GitHub - autoconf-archive/autoconf-archive: A mirror of the GNU Autoc…

数据分析软件-FineReport内置SQl提交

1. 概述 1.1 版本 报表服务器版本 功能变动 11.0.2 填报配置表时支持从数据库中模糊搜索表&#xff0c;详情见 2.2 节。 1.3 功能介绍 设计好填报表格&#xff0c;添加填报控件之后&#xff0c;如下图所示&#xff1a; 需要将填报数据的单元格与数据库表字段进行绑定&#…

【微服务】2、一篇文章详解 Ribbon 负载均衡

Ribbon 负载均衡一、负载均衡原理&#xff08;debug 源码&#xff09;(1) 基本介绍(2) 打断点① LoadBalancerInterceptor.java - intercept()② RibbonLoadBalancerClient.java - execute()③ RibbonLoadBalancerClient.java - execute()④ RibbonLoadBalancerClient.java - g…

【STM32】详解RTC实时时钟的概念和配置示例代码

一、什么是RTC RTC(Real-time Clock)&#xff1a;实时时钟&#xff0c;本质上是一个支持BCD编码的定时器/计数器。主电源断电后能够由电池供电&#xff0c;使其时钟跳转依然正常。 二、STM32F4芯片内的RTC功能 ①日历时钟&#xff08;时分秒、年月日、星期&#xff09; ②两个闹…

六、排序算法介绍3

4、希尔排序 4.1 简单插入排序问题 简单的插入排序可能存在的问题&#xff0c;数组 arr { 2, 3, 4, 5, 6, 1 } 这时需要插入的数 1(最小)&#xff0c;简单插入排序的过程如下&#xff1a; {2,3,4,5,6,6} {2,3,4,5,5,6} {2,3,4,4,5,6} {2,3,3,4,5,6} {2,2,3,4,5,6} {1,2,3,4,…

CCIA技术沙龙 | “数据安全风险评估及安全服务实践” 沙龙成功举办

2022年12月8日&#xff0c;由中国网络安全产业联盟&#xff08;CCIA&#xff09;主办、CCIA数据安全工作委员会支持、杭州美创科技股份有限公司承办的“数据安全风险评估及数据安全服务实践”主题技术沙龙成功举办。 当前&#xff0c;我国数字经济快速发展、数字化转型持续深入…

Java对象深拷贝详解(List深拷贝)

1、Java中拷贝的概念 在Java语言中&#xff0c;拷贝一个对象时&#xff0c;有浅拷贝与深拷贝两种 浅拷贝&#xff1a;只拷贝源对象的地址&#xff0c;所以新对象与老对象共用一个地址&#xff0c;当该地址变化时&#xff0c;两个对象也会随之改变。 深拷贝&#xff1a;拷贝对…

一起学习用Verilog在FPGA上实现CNN----(一)总体概述

1 总体概述 为避免闭门造车&#xff0c;找一个不错的开源项目&#xff0c;学习在FPGA上实现CNN&#xff0c;为后续的开发奠定基础 1.1 项目链接 大佬的开源项目链接&#xff1a; CNN-FPGA 链接跳转界面如下&#xff1a; 大佬的该项目已经发表论文&#xff0c;而且开源工程结…

Qt5.6.1移植海思Hi3521d(一)

系列文章目录 文章目录系列文章目录前言一、开发环境二、搭建环境1.准备2.海思SDK和交叉编译器安装2.测试交叉编译器一下3.安装tftp总结前言 上半年做个一个Qt移植海思芯片的程序&#xff0c;感觉差不多快忘记了&#xff0c;赶紧记录一下 一、开发环境 系统&#xff1a;Ubunt…

初学Python到月入过万最快的兼职途径(纯干货)

程序员小猴紫&#xff0c;不错过任何一次干赚钱干货 1.兼职薪资&#xff0c;附行哥工资单2.兼职门槛&#xff0c;附学习知识清单3.兼职途径&#xff0c;附入职考核过程4.我的兼职感受 答应小猴紫的第一篇赚钱干货推文来啦&#xff0c;行哥第一个在读书期间通过兼职赚到的10w收…

Web前端大作业—里约热内卢奥运会(html+css+javascript)

&#x1f389;精彩专栏推荐 &#x1f4ad;文末获取联系 ✍️ 作者简介: 一个热爱把逻辑思维转变为代码的技术博主 &#x1f482; 作者主页: 【主页——&#x1f680;获取更多优质源码】 &#x1f393; web前端期末大作业&#xff1a; 【&#x1f4da;毕设项目精品实战案例 (10…

产品经理 - 产品设计方法论需求分析部分

整体 – 产品设计方法论思维导图 个人整理&#xff0c;存在异议大家可以讨论下 需求分析方法论 需求分析为需求收集的延展&#xff0c;需求收集后即需进行需求分析&#xff0c;拆解需求后方可业务落地&#xff0c;此处我将其分为两步&#xff0c;一是主动发散型需求分析&am…

移动端项目(第十九课)Vite+Vant组件环境配置

常用到的环境配置时不我待(第十八课)项目环境搭建_星辰镜的博客-CSDN博客 在上面的环境的基础上加上下面的一下配置 Normalize.css: Make browsers render all elements more consistently. (necolas.github.io) 介绍 | Pinia 中文文档 (web3doc.top) Day.js 中文文档 - 2kB 大…

【Java版oj】day02排列子序列

目录 一、原题再现 二、问题分析 三、完整代码 一、原题再现 链接&#xff1a;排序子序列_牛客笔试题_牛客网 来源&#xff1a;牛客网 [编程题]排序子序列 热度指数&#xff1a;10105 时间限制&#xff1a;C/C 1秒&#xff0c;其他语言2秒 空间限制&#xff1a;C/C 32M&…

水果店引流活动推荐_分享水果店微信小程序制作步骤

试试做个小程序拯救你的店&#xff01;让你做出有效果的活动&#xff0c;每笔钱都花在刀刃上&#xff01; 第一&#xff0c;提升水果销量&#xff0c;降低损耗 用水果店小程序做拼团、砍价、秒杀活动&#xff0c;并讲原本卖不完的水果&#xff0c;做成果盘吸引客人注册会员。上…

Manufactoria介绍及各关卡解法

Manufactoria解法Manufactoria基本介绍解法RobotoastRoboManufactoria基本介绍 Manufactoria是一个以制造工厂为背景的程序设计游戏。在游戏中&#xff0c;玩家需要在有限的平面空间中巧妙地排布传送带&#xff0c;打点器与分支器&#xff0c;完成识别或改写特定模式的字符串的…

6.AOP之转账案例

数据准备 CREATE TABLE account (id int(11) NOT NULL,name varchar(100) NOT NULL,money decimal(7,2) NOT NULL,create_time datetime(6) NOT NULL,PRIMARY KEY (id) ) ENGINEInnoDB DEFAULT CHARSETutf8;insert into account values(1,"steven",10000,"2022…

循环程序设计 乘法口诀表

凡是写循环程序 必须满足两个条件 一是存在相同的操作 二是有规律 对于乘法口诀表 我们都很熟悉 如下图是左下角的 探求一下 规律&#xff1a; 1 多个乘法 2 规律性 第一1行 1个乘法运算 1*1 第二2行 2个乘法运算 1*2 2*2 第三3行 3个乘法运算 1*3 2*3 3*3 第四4行 4个…