• <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 獨孤九劍 閱讀(336) 評論(0)  編輯 收藏 引用 所屬分類: Visual C++ 8.0
            伊人久久大香线蕉综合影院首页 | 亚洲精品国精品久久99热一| 91精品国产综合久久四虎久久无码一级 | A级毛片无码久久精品免费| 久久91精品国产91久久户| 99热都是精品久久久久久| 久久久久久亚洲精品无码| 91麻豆国产精品91久久久| 久久久亚洲欧洲日产国码是AV| 日产精品99久久久久久| 国产精品va久久久久久久| 午夜精品久久久久久影视777| 2021国产精品久久精品| 日本精品久久久久中文字幕| 少妇久久久久久被弄到高潮 | 亚洲Av无码国产情品久久| 蜜臀av性久久久久蜜臀aⅴ麻豆| 久久久九九有精品国产| 国产精品久久久久免费a∨| 久久精品国产精品青草app| 亚洲国产香蕉人人爽成AV片久久| 国内精品九九久久久精品| 中文国产成人精品久久亚洲精品AⅤ无码精品 | 久久精品水蜜桃av综合天堂| 久久久久久国产精品无码下载| 亚洲精品乱码久久久久久按摩 | 亚洲伊人久久大香线蕉综合图片| 亚洲国产精品婷婷久久| 亚洲AV无码久久精品蜜桃| 亚洲а∨天堂久久精品| 国产精品欧美久久久久天天影视| 亚洲精品无码久久久久去q| 日本欧美国产精品第一页久久| 国产精品欧美久久久天天影视| 久久婷婷五月综合成人D啪| 国产免费久久精品丫丫| 国产精品久久久久久久久| 无码人妻久久久一区二区三区| 久久久久高潮综合影院| 久久人人爽人人爽人人片AV东京热| 久久久久亚洲精品中文字幕|