如何填充一个区域??
有一个区域,请问如果不使用windows的FillRgn和FloodPain,如何将其用指定颜色填充..()
或者,不能使用CreatePlyRgn函数如何自己构造这个区域???

解决方案 »

  1.   

    //  产生一个小区域
    CPoint pptsLine = new CPoint [4] ;
    pptsLine [0].x = 10 ;
    pptsLine [0].y = 10 ;
    pptsLine [1].x = 100 ;
    pptsLine [1].y = 10 ;
    pptsLine [2].x = 100 ;
    pptsLine [2].y = 100 ;
    pptsLine [3].x = 50 ;
    pptsLine [3].y = 170 ;CRgn  rgnFill ;
    rgnFill.CreatePolygonRgn( pptsLine , 4 , ALTERNATE ) ;
    CBrush brush ( RGB(0 ,255 , 0 ) ) ; // rgb颜色自选
    pDC->FillRgn ( &rgnFill , &brush ) ;if ( pptsLine )
        deltet[] pptsLine ;