• 大小: 0.08M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: C#
  • 标签: 其他  

资源简介

C#GDI绘图_BitMapDemo.rar

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;

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

        private bool flag = true;
        private void button1_Click(object sender EventArgs e)
        {
            timer1.Enabled = true;
        }

        private void button2_Click(object sender EventArgs e)
        {
            timer1.Enabled = false;
        }

        private void timer1_Tick(object sender EventArgs e)
        {
            DateTime t1 = DateTime.Now;
            Graphics g = this.CreateGraphics();
            LinearGradientBrush brush;
            if (flag)
            {
                brush = new LinearGradientBrush(new PointF(0.0f 0.0f)
                    new PointF(700.0f 300.0f) Color.Red Color.Blue);
                flag = false;
            }
            else
            {
                brush = new LinearGradientBrush(new PointF(0.0f 0.0f)
                    new PointF(700.0f 300.0f) Color.Blue Color.Red);
                flag = true;
            }
            for (int j = 0; j < 60; j++)
            {
                for (int i = 0; i < 60; i++)
                {
                    g.FillEllipse(brush i * 10 j * 10 10 10);
                }
            }
            DateTime t2 = DateTime.Now;
            TimeSpan sp = t2 - t1;
            float per = 1000 / sp.Milliseconds;
            this.label1.Text = “速度:“ + per.ToString() + “帧/秒“;

        }

        private void button3_Click(object sender EventArgs e)
        {
            timer2.Enabled = true;
        }

        private void timer2_Tick(object sender EventArgs e)
        {
            DateTime t1 = DateTime.Now;
            //双缓冲内存中建图--从程序到内存,从内存到显存,显存到屏幕
            Bitmap bt = new Bitmap(600 600);
            Graphics g = Graphics.FromImage(bt);
            LinearGradientBrush brush;
            if (flag)
            {
                brush = new LinearGradientBrush(new PointF(0.0f 0.0f)
                    new PointF(700.0f 300.0f) Color.Red Color.Blue);
                flag = false;
            }
            else
            {
                brush = new LinearGradientBrush(new PointF(0.0f 0.0f)
                    new PointF(700.0f 300.0f) Color.Blue Color.Red);
                flag = true;
            }
            for (int j = 0; j < 60; j++)
            {
                for (int i = 0; i < 60; i++)
                {
                    g.FillEllipse(brush i * 10 j * 10 10 10);
                    
                }
            }
            this.CreateGraphics().DrawImage(bt 0 0);
            DateTime t2 = DateTime.Now;
            TimeSpan sp = t2 - t1;
            float

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

     文件       3227  2009-02-17 14:41  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\BitMapDemo.csproj

     文件       3277  2009-02-19 16:42  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Form1.cs

     文件       5088  2009-02-17 15:13  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Form1.Designer.cs

     文件       6203  2009-02-17 15:13  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Form1.resx

     文件        469  2009-02-17 14:38  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Program.cs

     文件       1192  2009-02-17 14:38  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Properties\AssemblyInfo.cs

     文件       2874  2009-02-17 14:38  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Properties\Resources.Designer.cs

     文件       5612  2009-02-17 14:38  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Properties\Resources.resx

     文件       1093  2009-02-17 14:38  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Properties\Settings.Designer.cs

     文件        249  2009-02-17 14:38  C#GDI绘图_BitMapDemo\Backup\BitMapDemo\Properties\Settings.settings

     文件        919  2009-02-17 14:38  C#GDI绘图_BitMapDemo\Backup\BitMapDemo.sln

    ..A..H.     16384  2009-07-28 23:09  C#GDI绘图_BitMapDemo\Backup\BitMapDemo.v12.suo

     文件      10752  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\bin\Debug\BitMapDemo.exe

     文件      30208  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\bin\Debug\BitMapDemo.pdb

     文件      22704  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\bin\Debug\BitMapDemo.vshost.exe

     文件        490  2013-03-18 17:00  C#GDI绘图_BitMapDemo\BitMapDemo\bin\Debug\BitMapDemo.vshost.exe.manifest

     文件       3535  2019-11-12 13:45  C#GDI绘图_BitMapDemo\BitMapDemo\BitMapDemo.csproj

     文件       3277  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\Form1.cs

     文件       5668  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\Form1.Designer.cs

     文件       6203  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\Form1.resx

     文件        289  2009-07-28 23:08  C#GDI绘图_BitMapDemo\BitMapDemo\obj\BitMapDemo.csproj.FileList.txt

     文件       1842  2009-02-19 16:06  C#GDI绘图_BitMapDemo\BitMapDemo\obj\BitMapDemo.csproj.FileListAbsolute.txt

     文件        938  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\BitMapDemo.csproj.FileListAbsolute.txt

     文件        847  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\BitMapDemo.csproj.GenerateResource.Cache

     文件       1341  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\BitMapDemo.csprojResolveAssemblyReference.cache

     文件      10752  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\BitMapDemo.exe

     文件        180  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\BitMapDemo.Form1.resources

     文件      30208  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\BitMapDemo.pdb

     文件        180  2019-11-12 13:46  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\BitMapDemo.Properties.Resources.resources

     文件        791  2019-11-12 13:45  C#GDI绘图_BitMapDemo\BitMapDemo\obj\Debug\DesignTimeResolveAssemblyReferences.cache

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

评论

共有 条评论