-
c#教程之C#手工双缓冲技术用法实例分析
- 2018-02-12 21:20 来源:未知
本文实例讲述了C#手工双缓冲技术。分享给大家供大家参考。具体如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace advanced_drawing { public partial class Form19 : Form { BufferedGraphicsContext bufferContext; Bitmap gif = new Bitmap( @"d:/我的文档/桌面/ico/a.GIF" ); public Form19() { InitializeComponent(); bufferContext = new BufferedGraphicsContext(); bufferContext.MaximumBuffer = this .ClientRectangle.Size; } void gif_FrameChanged( object sender, EventArgs e) { Graphics g = this .CreateGraphics(); BufferedGraphics frame = bufferContext.Allocate(g, this .ClientRectangle); ImageAnimator.UpdateFrames(gif); frame.Graphics.DrawImage(gif, this .ClientRectangle); frame.Render(); } private void Form19_FormClosing( object sender, FormClosingEventArgs e) { bufferContext.Dispose(); } private void Form19_Paint( object sender, PaintEventArgs e) { if (ImageAnimator.CanAnimate(gif)) { ImageAnimator.Animate(gif, gif_FrameChanged); } } } } |
希望本文所述对大家的C#程序设计有所帮助。
最新更新
C#教程之Dapper简易教程(翻译自Github上Sta
C#教程之.Net4.6 Task 异步函数 比 同步函数
C#教程之.NET(C#、VB)移动开发——Smobi
C#教程之IIS将http强转为https(重定向和重
C#教程之c#源码如何生成托管代码块
C#教程之json提取嵌套数据
C#教程之C# 如何添加PPT背景(纯色背景、
C#教程之unity中播放视频
C#教程之c# 读取txt文档和写入文档的方法
C#教程之字符串加密
asp.net教程之纯ASP上传图像文件到数据库实
asp.net教程之ASP错误处理
asp.net教程之ASP网站防范黑客技巧
asp.net教程之用ASP取出HTML里面的图片地址
asp.net教程之ASP实现网页打开任何类型文件
asp.net教程之ASP木马Webshell安全解决办案
asp.net教程之几招让你的网站免受采集之苦
asp.net教程之ASP使用MYSQL数据库全攻略
asp.net教程之Ad Rotator 组件参考
asp.net教程之在Asp中使用存储过程数值类型
sql语句大全之SQL递归查询知多少
sql语句大全之SQL Server 2012 - 多表连接查询
sql语句大全之SQL Server 2012 - 开窗函数
sql语句大全之“RESOURCE MONITOR“CPU占用特别
sql语句大全之关系型数据库基本概念及
sql语句大全之T-SQL语句
sql语句大全之记一个常见的ms sql server中取
sql语句大全之游标 的使用
sql语句大全之sp_executesql 或者 EXECUTE 执行
sql语句大全之SQL Server 用角色(Role)管理数