屏幕录制gif软件_手机录屏咋录内部声音

屏幕录制gif软件_手机录屏咋录内部声音效果图如下:铜鼓录制屏幕的区域可以预览生成的GIF图片图片比较清晰源码中可以修改gif质量源码中可以修改gif帧数通过鼠标选择需要的区域FrmRectfrmRect=newFrmRect();frmRect.ShowDialog();m_rect=frmRect.Rect;label4.Text=”区域设定完成”;protec..

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

效果图如下:

屏幕录制gif软件_手机录屏咋录内部声音

工程源码见文章结尾

通过录制屏幕的区域 可以预览生成的GIF图片 图片比较清晰 源码中可以修改gif质量 源码中可以修改gif帧数 通过鼠标选择需要的区域

屏幕录制gif软件_手机录屏咋录内部声音

 屏幕录制gif软件_手机录屏咋录内部声音

屏幕录制gif软件_手机录屏咋录内部声音


            FrmRect frmRect = new FrmRect();
            frmRect.ShowDialog();
            m_rect = frmRect.Rect;
            label4.Text = "区域设定完成";
   protected override void OnLoad(EventArgs e) {
            Rectangle rect = Win32.GetDesktopRect();
            this.Location = rect.Location;
            this.Size = rect.Size;

            m_img = this.GetScreen();
            m_imgDark = new Bitmap(this.Width,this.Height);
            using (SolidBrush sb = new SolidBrush(Color.FromArgb(127, 0, 0, 0))) {

.......
}

  private Image GetScreen() {
            Bitmap bmp = new Bitmap(this.Width, this.Height);
            using (Graphics g = Graphics.FromImage(bmp)) {
                g.CopyFromScreen(0, 0, 0, 0, bmp.Size);

 屏幕录制gif软件_手机录屏咋录内部声音

  if (btn_start.Text == "开始录制")
            {
                if (m_scrRecorder != null) m_scrRecorder.Clear();
                m_scrRecorder = null;

                if (m_scrRecorder == null)
                {
                    if (m_rect != Rectangle.Empty)
                    {
                        m_scrRecorder = new ScreenRecorder(m_rect, 100);
                        

                    }
                    else
                    {
                        MessageBox.Show("确保对应的录制方式 有选择数据");
                        return;
                    }
                }
                m_scrRecorder.DrawCursor = chk_drawMouse.Checked;
                m_scrRecorder.Start();
                btn_start.Text = "停止";
                btn_preview.Enabled = false;
                label4.Text = "正在录制";

            }
            else
            {
                m_scrRecorder.Stop();
                btn_start.Text = "开始录制";
                 btn_preview.Enabled = true;
                label4.Text = "录制完成";

            }
        }

屏幕录制gif软件_手机录屏咋录内部声音

 private string GetImageHash(Image img)
        {
            using (MemoryStream ms = new MemoryStream())
            {
                img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                byte[] byImg = new byte[ms.Length];
                ms.Seek(0, SeekOrigin.Begin);
                ms.Read(byImg, 0, byImg.Length);
                return BitConverter.ToString(System.Security.Cryptography.MD5.Create().ComputeHash(byImg)).Replace("-", "");
            }
        }
    }

屏幕录制gif软件_手机录屏咋录内部声音

       private bool m_bGet;
        private GIFColorDepth m_cd;
        private List<byte> m_lst = new List<byte>();


        private int m_nIndexTrans;                        // transparent index in color table
        private int m_nRepeat = 0;                        // 0=repeat forever

        private byte[] m_nIndexedPixels;                  // converted frame indexed to palette
        private byte[] m_byColorTabs;                     // RGB palette
        private bool[] m_bUsedEntrys = new bool[256];     // active palette entries
        private int m_nPalSize = 7;                       // color table size (bits-1)
        private int n_nDispose = -1;                      // disposal code (-1 = use default)
        private bool m_bFirstFrame = true;

        public GIFCreator(int nWidth, int nHeight, GIFColorDepth cd) {
            this._Width = nWidth;
            this._Height = nHeight;
            m_cd = cd;
            m_lst.AddRange(Encoding.ASCII.GetBytes("GIF89a"));
            this.WriteLSD();    // logical screen descriptior
        }

        public void AddFrame(Image img, int nSleep) {
            if (m_bGet) {       //如果获取过图像数据 那么把末尾的结束标志去掉
                m_lst.RemoveAt(m_lst.Count - 1);
                m_bGet = false;
            }
            this.AnalyzePixels(this.GetImagePixels(img));   // build color table & map pixels
            if (m_bFirstFrame) {
                this.WritePalette();                        // global color table
                if (m_nRepeat >= 0) {
                    this.WriteNetscapeExt();                // use NS app extension to indicate reps
                }
            }
            this.WriteGraphicCtrlExt(nSleep);               // write graphic control extension
            this.WriteImageDesc();                          // image descriptor
            if (!m_bFirstFrame) {
                this.WritePalette();                        // local color table
            }
            this.WritePixels();                             // encode and write pixel data
            m_bFirstFrame = false;
        }

屏幕录制gif软件_手机录屏咋录内部声音


项目链接

GIF录屏制作工具_录制屏幕生成GIF-C#文档类资源-CSDN下载

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/191571.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • sublime如何实现函数折叠

    sublime如何实现函数折叠

    2021年9月23日
    54
  • Java的@Transactional事务回滚

    @Transactional基本原理概述在应用系统调用声明@Transactional的目标方法时,SpringFramework默认使用AOP代理,在代码运行时生成一个代理对象,根据@Transactional的属性配置信息,这个代理对象决定该声明@Transactional的目标方法是否由拦截器TransactionInterceptor来使用拦截,在Transacti…

    2022年4月9日
    857
  • 工厂三姐妹

    工厂三姐妹工厂三姐妹

    2022年4月24日
    58
  • LayUI树形表格treetable使用详解

    LayUI树形表格treetable使用详解LayUI是现在比较流行的一款前端框架,也有很多人基于LayUI开发了很多不错的组件,比如treetable树形表格。因为treetable是第三方基于LayUI开发的,所以需要先用Layui引入一下文件。layui.config({base:’static/layui/’}).extend({treetable:’treetable-lay/treetab…

    2022年6月13日
    420
  • 批处理 for循环[通俗易懂]

    批处理 for循环[通俗易懂]批处理

    2022年10月12日
    2
  • 垃圾清理代码_一招清理电脑垃圾

    垃圾清理代码_一招清理电脑垃圾hello,大家好,我是你们的小雨哥哥。今天要教大家的是如何一键清理电脑的垃圾文件。众所周知,电脑用久了会越来越卡,运行的越来越慢,这其中除了硬件的损耗之外,还有一个原因就是电脑的垃圾文件越来越多,缓存文件越来越多。很多程序,例如浏览器,在使用过一次之后,为了下次打开的速度快一点,它会自动保留一下缓存文件,然后等待下来打开的时候就不用去请求服务器了,直接读取电脑本地的缓存…

    2022年6月18日
    46

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号