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); } } } }
希望本文所述對大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
C#動(dòng)態(tài)編譯并執(zhí)行字符串樣例
這篇文章主要為大家詳細(xì)介紹了C#動(dòng)態(tài)編譯并執(zhí)行字符串樣例,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-07-07WPF中下拉框可作選擇項(xiàng)也可以作為只讀文本框使用的方法
這篇文章主要給大家介紹了關(guān)于WPF中下拉框可以選擇項(xiàng)也可以作為只讀文本框使用的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2023-02-02在c#中使用servicestackredis操作redis的實(shí)例代碼
本篇文章主要介紹了在c#中使用servicestackredis操作redis的實(shí)例代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-06-06