• 大小: 363KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-02
  • 语言: C#
  • 标签: winfor  c#  鼠标滚轮  

资源简介

winform自绘波形,鼠标滚轮滚动以鼠标为中心缩放波形尺寸,鼠标按下图形左右拖拽图形,1~2键盘按键可以画出俩个时间标尺计算俩个标尺之间的时间,双缓冲panel自定义控件绘图不闪烁

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    { 

        public Form1()
        {
            InitializeComponent();
        }

        int num = 1;
        int x1 = 0;
        int y1 = 100;
        int x2 = 50;
        int y2 = 100;

        int x3 = 0;
        int y3 = 200;
        int x4 = 50;
        int y4 = 200;

        int x5 = 0;
        int y5 = 300;
        int x6 = 50;
        int y6 = 300;

        int x7 = 0;
        int y7 = 400;
        int x8 = 50;
        int y8 = 400;

        int x = 0;
        int xx = 0;

        List ps = new List();

        Bitmap bmp;
        Bitmap Getbitmap(int width int height)
        {
            bmp = new Bitmap(width height);

            Graphics g = Graphics.FromImage(bmp);

            Font font = new Font(“微软雅黑“ 7);

            //g.Clear(Color.Black);

            num = 1;
            x1 = 0;
            y1 = 100;
            x2 = 50;
            y2 = 100;

            x3 = 0;
            y3 = 200;
            x4 = 50;
            y4 = 200;

            x5 = 0;
            y5 = 300;
            x6 = 50;
            y6 = 300;

            x7 = 0;
            y7 = 400;
            x8 = 50;
            y8 = 400;

            for (int j = 0; j < contorl; j++)
            {
                num *= 2;
            }

            if (pd)
            {
                x = doubleBufferPanel1.HorizontalScroll.Value + PointToClient(MousePosition).X - 0;
                //g.DrawLine(Pens.Green doubleBufferPanel1.HorizontalScroll.Value + PointToClient(MousePosition).X 0 doubleBufferPanel1.HorizontalScroll.Value + PointToClient(MousePosition).X pictureBox1.Height);
            }
            else if (pd1)
            {
                xx = doubleBufferPanel1.HorizontalScroll.Value + PointToClient(MousePosition).X - 0;
                //g.DrawLine(Pens.Green doubleBufferPanel1.HorizontalScroll.Value + PointToClient(MousePosition).X 0 doubleBufferPanel1.HorizontalScroll.Value + PointToClient(MousePosition).X pictureBox1.Height);
            }
            
            if (judge1 || pd)
            {
                if (add)
                {
                    x = (x - 50) * 2 + 50;
                }
                else if(subtract)
                {
                    x = (x - 50) / 2 + 50;
                }
                g.DrawLine(Pens.Green x 0 x pictureBox1.Height);
                g.DrawLine(Pens.Green x 0 x + 15 10);
                g.DrawLine(Pens.Green x + 15 10 x 20);
                g.DrawString(“1“ font Brushes.White x 3);
            }
            
            if (judge2 || pd1)
            {
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     33280  2019-02-28 16:24  WindowsFormsApplication1\.vs\WindowsFormsApplication1\v14\.suo

    ..A..H.     53248  2019-03-27 09:18  WindowsFormsApplication1\.vs\WindowsFormsApplication1\v15\.suo

     文件          0  2019-03-01 08:49  WindowsFormsApplication1\.vs\WindowsFormsApplication1\v15\Server\sqlite3\db.lock

     文件    1695744  2019-03-04 17:06  WindowsFormsApplication1\.vs\WindowsFormsApplication1\v15\Server\sqlite3\storage.ide

     文件      32768  2019-03-27 08:58  WindowsFormsApplication1\.vs\WindowsFormsApplication1\v15\Server\sqlite3\storage.ide-shm

     文件    4128272  2019-03-05 14:31  WindowsFormsApplication1\.vs\WindowsFormsApplication1\v15\Server\sqlite3\storage.ide-wal

     文件        184  2019-03-04 11:59  WindowsFormsApplication1\WindowsFormsApplication1\App.config

     文件      23040  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

     文件        184  2019-03-04 11:59  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config

     文件      30208  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb

     文件      22696  2019-02-28 18:48  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe

     文件        189  2019-02-28 12:15  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config

     文件        490  2018-04-12 07:35  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest

     文件      18859  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs

     文件       6945  2019-03-05 14:29  WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs

     文件       8666  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx

     文件      46078  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7015  2019-03-04 12:00  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2019-02-28 12:15  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2019-02-28 12:15  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2019-02-28 12:15  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       3584  2019-03-04 11:59  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件         42  2019-03-04 11:59  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.CoreCompileInputs.cache

     文件       3983  2019-03-04 17:26  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt

     文件       1012  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.cache

     文件     123324  2019-03-01 18:04  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csprojAssemblyReference.cache

     文件       2384  2019-02-28 17:52  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache

     文件      23040  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe

     文件       4744  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form1.resources

     文件      30208  2019-03-27 09:04  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.pdb

............此处省略29个文件信息

评论

共有 条评论