• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            道。道。道

            安全特性不等于安全的特性

               :: 首頁 :: 聯系 :: 聚合  :: 管理

            常用鏈接

            搜索

            •  

            最新評論

            Introduction

            This is a simple example about GDI+ which I used in my first GDI+ project.This article is focused on Double Buffering. First if you want to add GDI+ supports to your project,you can refer to Starting with GDI+ By Christian Graus.
            The main part of my example is in OnPaint function that you can see everything there,Image,Font,Brush and etc.They are very clear so I don't discuss about them.I only explain "Double Buffering" here.


            As you know you can draw images into your windows and create a brush or pen from TextureBrush and draw shapes or line, using the image.Even you can draw a text using the images by supplying TextureBrush.(you can see the examples in this article or Christian Grause articles)

            I think one of the most important use of images is Double Buffernig technique.This technique is used when the drawing we wish to create has many details,and it is time consuming to draw even with a fast computer.In this situation it seems the image creeps on to the screen while being drawn.For example in mapping applications or CAD/CAM applications we would encounter this problem. In this technique instead of drawing in the screen,first we draw into an image and then we draw the iamge into the window. Here is my example in double buffering:

            				   srand( (unsigned)time( NULL ) );
               int number = rand();
               number /= RAND_MAX + 1; 
               number *= 254;
            
               Rect rc(rect.left,rect.top,rect.right,rect.bottom);
                  Bitmap bmp(rect.right,rect.bottom);
            
               // Create a Graphics object that is associated with the image.
               Graphics* graph = Graphics::FromImage(&bmp);
             
               for(int x=0;x<rect.right;x++)
               {
               	for(int y=0; y<rect.bottom; y++)
               	{
               		double number = rand();
              		number /= RAND_MAX + 1; 
            		number *= 254;
            		Pen pen(Color(number,number,number,number));
            		graph->DrawLine(&pen,0,0,x,y);
                    	}
            	}
               // Draw the altered image.
               graphics.DrawImage(&bmp,rect.left,rect.top,rect.right,rect.bottom);
            
            		

            It takes 36 seconds to paint the screen on my computer(AMD 1.33GHtz and 256Mb RAM) without double buffering but only 5 seconds with this technique.You know,it is not interesting to wait 36 seconds each time that your window need to repaint!

            Finally I want to thank Christian Graus for his supports and good articles about GDI+ which I used some of his codes and ideas.

            posted on 2006-11-18 16:43 獨孤九劍 閱讀(345) 評論(0)  編輯 收藏 引用 所屬分類: Visual C++ 8.0
            国产农村妇女毛片精品久久 | 久久成人小视频| 久久综合久久综合亚洲| 婷婷国产天堂久久综合五月| 亚洲级αV无码毛片久久精品| 狠狠干狠狠久久| 青青热久久国产久精品| 久久精品国产亚洲AV香蕉| 香蕉久久一区二区不卡无毒影院| 伊人久久大香线蕉无码麻豆| 色欲av伊人久久大香线蕉影院| 亚洲天堂久久精品| 三上悠亚久久精品| 99久久做夜夜爱天天做精品| 欧美777精品久久久久网| 综合网日日天干夜夜久久| 精品久久久久久99人妻| 久久ZYZ资源站无码中文动漫| 伊人久久精品影院| 丁香五月综合久久激情| 久久久无码精品亚洲日韩蜜臀浪潮| 人人狠狠综合久久亚洲| 国产精品无码久久久久 | 久久国产精品久久国产精品| 久久无码AV一区二区三区| 久久精品无码一区二区三区免费| a级成人毛片久久| 国产一区二区精品久久| 无码国内精品久久人妻| 2021最新久久久视精品爱 | 一本大道久久香蕉成人网| 一本大道久久a久久精品综合 | 久久精品国产色蜜蜜麻豆 | 亚洲狠狠婷婷综合久久久久| 狠狠色丁香婷婷久久综合五月| 久久久久亚洲AV成人网| 久久五月精品中文字幕| 久久久久国产一区二区三区| 久久强奷乱码老熟女网站| 亚洲人成网站999久久久综合 | 亚洲国产精品久久电影欧美|