码迷,mamicode.com
首页 > 其他好文 > 详细

GDI+实现双缓冲绘图方法一

时间:2014-05-07 13:15:11      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   java   tar   

bubuko.com,布布扣
        private void Form5_MouseMove(object sender, MouseEventArgs e)
        {
            int intOX = rectDrawArea.X;
            int intOY = rectDrawArea.Y;
            rectDrawArea.X = e.X;
            rectDrawArea.Y = e.Y;
            Debug.WriteLine(rectDrawArea.ToString());
            //Invalidate();
            MyDrawFun();
        }

        private void MyDrawFun()
        {
            Graphics go = Graphics.FromHwnd(this.Handle);
            Bitmap bitmap = new Bitmap(this.ClientSize.Width, this.ClientSize.Height);
            Graphics g = Graphics.FromImage(bitmap);
            g.Clear(System.Drawing.SystemColors.Control);
            g.DrawRectangle(Pens.Red, rectDrawArea);
            Bitmap logo = Properties.Resources.baidulogo;
            g.DrawImage(logo, 0, 0);
            go.DrawImage(bitmap, 0, 0, this.ClientSize.Width, this.ClientSize.Height);
            g.Dispose();
            bitmap.Dispose();
        }
bubuko.com,布布扣

 

GDI+实现双缓冲绘图方法一,布布扣,bubuko.com

GDI+实现双缓冲绘图方法一

标签:style   blog   class   code   java   tar   

原文地址:http://www.cnblogs.com/qiu2013/p/3712811.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!