Radians = (double)Time;MoveTo(CenterX,CenterY);
CPen Pen(PS_SOLID,5,RGB(255,255,0));
CPen *OldPen = pDC->SelectObject(&Pen),y,
CenterY - (int)((double)(CenterY*2/3)*cos(Radians)));
Radians = (double)Time.GetSecond();
Radians *= 6.28/,Rect.bottom-5);
double Radians;
pDC->.0.GetMinute()+(double)Time.GetSecond()/60;TextOut(x;i <,str::GetCurrentTime();12.0;
x = CenterX - (size;
/3)*sin(Radians);
CTime Time = CTime;
pDC->LineTo(CenterX + (int)((double)(CenterX*2)/
pDC->
pDC->Ellipse(5,5,Rect;SetTextColor(RGB(255,0,0));
for(i = 1.cx/2) + (int)((double)(CenterX - 20)*
sin(Radians));12.0;
CPen HourPen(PS_SOLID,5,RGB(0,255,0));
pDC->GetTextExtent(str;2;
pDC->.GetSecond()/,CenterY);
pDC->/ TODO: add draw code for native data here
RECT Rect;
GetClientRect(&Rect);
int CenterX = Rect.right/2;
int CenterY = Rect.bottom/SelectObject(&HourPen);
pDC->MoveTo(CenterX;3)*sin(Radians)),
CenterY - (int)((double)(CenterY/
Radians *= 6;
CString str;
int i;
y = CenterY - (size,str);
}
Radians = (double)Time;
pDC->SelectObject(&MinutePen),y;LineTo(CenterX + (int)((double)(CenterX*4)/5)*sin(Radians),
CenterY - (int)((double)(CenterY*4)/5*cos(Radians)));
CPen MinutePen(PS_SOLID,3,0,RGB(0,i);
size = pDC->3)*cos(Radians)));3600.0;
Radians *= 6.28/.0:OnDraw(CDC* pDC)
{
CMyClockDoc* pDoc = GetDocument()void CMyClockView:;
ASSERT_VALID(pDoc).right-5;
pDC->SelectObject(OldPen).GetLength());
Radians = (double)i*6.28/
CSize size.Format("%d".cy/2) - (int)((double)(CenterY - 20)*
cos(Radians));LineTo(CenterX + (int)((double)(CenterX/,CenterY);
pDC->.GetHour() + (double)Time.GetMinute()/60,255)).0 +
(double)Time;SelectObject(&SecondPen);
pDC->MoveTo(CenterX.28/60;60.0;
CPen SecondPen(PS_SOLID,1,RGB(0,255,255));
pDC->,x;= 12;i++){
str
要怎么修改下面这段代码,才能使本来是椭圆图形变成圆形的?? 急求!!
答案:2 悬赏:0 手机版
解决时间 2021-02-15 15:13
- 提问者网友:王者佥
- 2021-02-15 08:34
最佳答案
- 五星知识达人网友:長槍戰八方
- 2021-02-15 09:05
pDC->Ellipse(5,5,Rect.right-5,Rect.bottom-5);
这里指明了外接矩形的左上角 右下角坐标,如果你设置这两个坐标 让长和宽相等时就是圆了
也就是 Rect.right-5-5 = Rect.bottom-5-5 长宽相等的时候就是圆了
这里指明了外接矩形的左上角 右下角坐标,如果你设置这两个坐标 让长和宽相等时就是圆了
也就是 Rect.right-5-5 = Rect.bottom-5-5 长宽相等的时候就是圆了
全部回答
- 1楼网友:野慌
- 2021-02-15 09:41
你好!
CenterY-25,CenterX+25,CenterY+25);
看你后面用20计算字的位置,25应该差不多pDC->Ellipse(CenterX-25
如有疑问,请追问。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯