3 个解决方案
#1
先建立一个实心画刷,之后在画圆的时候用这个画刷来画就就可以了
#2
我空心跟實心的繪圖是要分開來做的,先能畫出空心矩形,然後點選顏色填充時,可以再已繪出的圖形內加入填充色彩,目前試過FillPath()、FillRgn(),都卡在已繪出的圖型路徑要如何傳值給case2去做填充顏色的動作
#3
CRgn::PtInRegion
BOOL PtInRegion( int x, int y ) const;
BOOL PtInRegion( POINT point ) const;
Return Value
Nonzero if the point is in the region; otherwise 0.
Parameters
x
Specifies the logical x-coordinate of the point to test.
y
Specifies the logical y-coordinate of the point to test.
point
The x- and y-coordinates of point specify the x- and y-coordinates of the point to test the value of. The point parameter can either be a POINT structure or a CPoint object.
Remarks
Checks whether the point given by x and y is in the region stored in the CRgn object.
CRgn Overview | Class Members | Hierarchy Chart
See Also ::PtInRegion
CDC::FillRgn
BOOL FillRgn( CRgn* pRgn, CBrush* pBrush );
Return Value
Nonzero if the function is successful; otherwise 0.
Parameters
pRgn
A pointer to the region to be filled. The coordinates for the given region are specified in device units.
pBrush
Identifies the brush to be used to fill the region.
Remarks
Fills the region specified by pRgn with the brush specified by pBrush.
The brush must either be created using the CBrush member functions CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, or be retrieved by GetStockObject.
CDC Overview | Class Members | Hierarchy Chart
See Also CDC::PaintRgn, CDC::FillRect, CBrush, CRgn,::FillRgn
BOOL PtInRegion( int x, int y ) const;
BOOL PtInRegion( POINT point ) const;
Return Value
Nonzero if the point is in the region; otherwise 0.
Parameters
x
Specifies the logical x-coordinate of the point to test.
y
Specifies the logical y-coordinate of the point to test.
point
The x- and y-coordinates of point specify the x- and y-coordinates of the point to test the value of. The point parameter can either be a POINT structure or a CPoint object.
Remarks
Checks whether the point given by x and y is in the region stored in the CRgn object.
CRgn Overview | Class Members | Hierarchy Chart
See Also ::PtInRegion
CDC::FillRgn
BOOL FillRgn( CRgn* pRgn, CBrush* pBrush );
Return Value
Nonzero if the function is successful; otherwise 0.
Parameters
pRgn
A pointer to the region to be filled. The coordinates for the given region are specified in device units.
pBrush
Identifies the brush to be used to fill the region.
Remarks
Fills the region specified by pRgn with the brush specified by pBrush.
The brush must either be created using the CBrush member functions CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, or be retrieved by GetStockObject.
CDC Overview | Class Members | Hierarchy Chart
See Also CDC::PaintRgn, CDC::FillRect, CBrush, CRgn,::FillRgn
#1
先建立一个实心画刷,之后在画圆的时候用这个画刷来画就就可以了
#2
我空心跟實心的繪圖是要分開來做的,先能畫出空心矩形,然後點選顏色填充時,可以再已繪出的圖形內加入填充色彩,目前試過FillPath()、FillRgn(),都卡在已繪出的圖型路徑要如何傳值給case2去做填充顏色的動作
#3
CRgn::PtInRegion
BOOL PtInRegion( int x, int y ) const;
BOOL PtInRegion( POINT point ) const;
Return Value
Nonzero if the point is in the region; otherwise 0.
Parameters
x
Specifies the logical x-coordinate of the point to test.
y
Specifies the logical y-coordinate of the point to test.
point
The x- and y-coordinates of point specify the x- and y-coordinates of the point to test the value of. The point parameter can either be a POINT structure or a CPoint object.
Remarks
Checks whether the point given by x and y is in the region stored in the CRgn object.
CRgn Overview | Class Members | Hierarchy Chart
See Also ::PtInRegion
CDC::FillRgn
BOOL FillRgn( CRgn* pRgn, CBrush* pBrush );
Return Value
Nonzero if the function is successful; otherwise 0.
Parameters
pRgn
A pointer to the region to be filled. The coordinates for the given region are specified in device units.
pBrush
Identifies the brush to be used to fill the region.
Remarks
Fills the region specified by pRgn with the brush specified by pBrush.
The brush must either be created using the CBrush member functions CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, or be retrieved by GetStockObject.
CDC Overview | Class Members | Hierarchy Chart
See Also CDC::PaintRgn, CDC::FillRect, CBrush, CRgn,::FillRgn
BOOL PtInRegion( int x, int y ) const;
BOOL PtInRegion( POINT point ) const;
Return Value
Nonzero if the point is in the region; otherwise 0.
Parameters
x
Specifies the logical x-coordinate of the point to test.
y
Specifies the logical y-coordinate of the point to test.
point
The x- and y-coordinates of point specify the x- and y-coordinates of the point to test the value of. The point parameter can either be a POINT structure or a CPoint object.
Remarks
Checks whether the point given by x and y is in the region stored in the CRgn object.
CRgn Overview | Class Members | Hierarchy Chart
See Also ::PtInRegion
CDC::FillRgn
BOOL FillRgn( CRgn* pRgn, CBrush* pBrush );
Return Value
Nonzero if the function is successful; otherwise 0.
Parameters
pRgn
A pointer to the region to be filled. The coordinates for the given region are specified in device units.
pBrush
Identifies the brush to be used to fill the region.
Remarks
Fills the region specified by pRgn with the brush specified by pBrush.
The brush must either be created using the CBrush member functions CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, or be retrieved by GetStockObject.
CDC Overview | Class Members | Hierarchy Chart
See Also CDC::PaintRgn, CDC::FillRect, CBrush, CRgn,::FillRgn