📄 drawcircle_rockey.cpp
字号:
#include "stdafx.h"
#include "DrawCircle.h"
#include "DrawCircleDoc.h"
#include "DrawCircleView.h"
#include "DrawParamDlg.h"
#include "DrawMethodDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
WORD p1=0xc44c,p2=0xc8f8,p3=0x0799,p4=0xc43b;
DWORD lp1,lp2;
WORD handle[16];
BYTE buffer[1024];
void CDrawCircleView::DrawCircleMidPoint_Rockey(CDC *pDC, int iCenterX, int iCenterY, int r)
{
int x=0;
int y=r;
int p=1-r;
int seed=0;
short p1,p2,p3,p4;
CirclePlotPoints(pDC,iCenterX,iCenterY,x,y);
TRACE("Hardware\n");
m_lpCircleBuf[0].x = x;
m_lpCircleBuf[0].y = y;
m_nPointCount=1;
while(x<y)
{
p1 = p;
p2 = x;
p3 = y;
p4 = seed;
if(!RunRockey((WORD&)p1,(WORD&)p2,(WORD&)p3,(WORD&)p4))
{
// AfxMessageBox("运行时错误");
break;
}
if(p<0)
{
p = p1;
}
else
{
p = p2;
y--;
}
x++;
TRACE("%d,(%d,%d);",p,x,y);
CirclePlotPoints(pDC,iCenterX,iCenterY,x,y);
m_lpCircleBuf[m_nPointCount].x = x;
m_lpCircleBuf[m_nPointCount].y = y;
m_nPointCount++;
}
TRACE("\n");
}
BOOL CDrawCircleView::RunRockey(WORD &A, WORD &B, WORD &C, WORD &D)
{
WORD retcode;
lp1 = 10;
retcode = Rockey(RY_CALCULATE1,&handle[0],&lp1,&lp2,&A,&B,&C,&D,buffer);
if(retcode)
return FALSE;
else
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -