19,468
社区成员
发帖
与我相关
我的任务
分享
void Ccrayoon3Dlg::OnMouseMove(UINT nFlags, CPoint point)
{
int dx = point.x - apoint.x, dy = point.y - apoint.y, steps, k;
float xIncrement, yIncrement, x = apoint.x, y = apoint.y;
//
if (abs (dx) > abs (dy))
{
steps = abs (dx);
}
else
{
steps = abs (dy);
}//
xIncrement = dx / (float) steps;
yIncrement = dy / (float) steps;
//
Graphics graphics(this->m_hWnd);
Image image(_T("1.jpg"));
CRect rect;
GetClientRect(rect);
CPoint savepoint;
//graphics.RotateTransform(30);
//
for (k=0; k<steps; k++)
{
x += xIncrement;
y += yIncrement;
savepoint.x=x;
savepoint.y=y;
graphics.DrawImage(&image,savepoint.x,savepoint.y,5,40);
}
apoint.x=point.x;
apoint.y=point.y;
}