Draw filled circle
-
Hi, I want to draw very small red,green color circle. So i use Ellipse fuctionality. But its draw as hollow. I want filled circle with different brush color. How can i do that?
Anu
Create the colored brush using
CreateSolidBrush
. UseSelectObject
to select the brush into the device context used in the first parameter ofEllipse
.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
Create the colored brush using
CreateSolidBrush
. UseSelectObject
to select the brush into the device context used in the first parameter ofEllipse
.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
http://msdn.microsoft.com/en-us/library/dd162510(VS.85).aspx[^]
«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
Hi, I want to draw very small red,green color circle. So i use Ellipse fuctionality. But its draw as hollow. I want filled circle with different brush color. How can i do that?
Anu
To fill the Ellipse when you draw it, you need first to create a Brush of the correct colour and then load it into the current Device Context. Then when you call the Ellipse function it will fill it with the correct colour. :) Something like this ....
CBrush brMine; CBrush \*pOldBrush = NULL; brMine.CreateSolidBrush(crRed); pOldBrush = pDC->SelectObject(&brRed);
Then draw your Ellipse. :)
Ali
-
Hi, I want to draw very small red,green color circle. So i use Ellipse fuctionality. But its draw as hollow. I want filled circle with different brush color. How can i do that?
Anu
Try this...
CDC \*pDC = GetDC(); CRect rect; GetClientRect(rect); CBrush brush; brush.CreateSolidBrush(RGB(255,0,0)); CBrush \*pOldBrush= pDC->SelectObject(&brush); pDC->Ellipse(rect); pDC->SelectObject(pOldBrush); ::ReleaseDC(m\_hWnd,pDC->m\_hDC );
-
Hi, I want to draw very small red,green color circle. So i use Ellipse fuctionality. But its draw as hollow. I want filled circle with different brush color. How can i do that?
Anu