C#手工雙緩沖技術(shù)用法實(shí)例分析
更新時(shí)間:2015年06月12日 17:19:02 作者:zhuzhao
這篇文章主要介紹了C#手工雙緩沖技術(shù)用法,實(shí)例分析了手工雙緩沖技術(shù)的實(shí)現(xiàn)技巧,需要的朋友可以參考下
本文實(shí)例講述了C#手工雙緩沖技術(shù)。分享給大家供大家參考。具體如下:
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);
}
}
}
}
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
SMTP客戶端未通過身份驗(yàn)證等多種錯(cuò)誤解決方案分享
這篇文章主要介紹了SMTP服務(wù)器要求安全連接或客戶端未通過身份驗(yàn)證的多種解決方案,感興趣的小伙伴們可以參考一下2016-05-05
DevExpress之ChartControl用法實(shí)例總結(jié)
這篇文章主要介紹了DevExpress之ChartControl用法實(shí)例總結(jié),需要的朋友可以參考下2014-08-08
C#如何實(shí)現(xiàn)監(jiān)控手機(jī)屏幕(附源碼下載)
這篇文章主要介紹了C#如何實(shí)現(xiàn)監(jiān)控手機(jī)屏幕(附源碼下載),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-10-10
在c#中使用servicestackredis操作redis的實(shí)例代碼
本篇文章主要介紹了在c#中使用servicestackredis操作redis的實(shí)例代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-06-06
c# 如何實(shí)現(xiàn)一個(gè)簡(jiǎn)單的json解析器
這篇文章主要介紹了c# 如何實(shí)現(xiàn)一個(gè)簡(jiǎn)單的json解析器,文中講解非常細(xì)致,代碼幫助大家更好的理解和學(xué)習(xí),感興趣的朋友可以了解下2020-07-07
c# 9.0新特性nint和Pattern matching的使用方法
這篇文章主要介紹了c# 9.0新特性nint和Pattern matching的使用方法,文中講解非常細(xì)致,幫助你更好的學(xué)習(xí)c# 9.0,有需求的朋友可以參考下2020-06-06
C#中判斷字符串是全角還是半角的實(shí)現(xiàn)代碼
本篇文章主要是對(duì)C#中判斷字符串是全角還是半角的實(shí)現(xiàn)代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2014-01-01

