Fri Jul 27, 2012 10:31 pm
vector<double> xCof = GetHermiteCoeff(P0.first, T0.first, P3.first, T1.first);
vector<double> yCof = GetHermiteCoeff(P0.second, T0.second, P3.second, T1.second);
if(numPix < 2) return;
double dt = 1.0 / (numPix - 1);
tagLOGPEN tp;
tp.lopnColor = color;
tp.lopnStyle = PS_SOLID;
tp.lopnWidth.x = 1;
HPEN p = CreatePenIndirect(&tp);
SelectObject(hdc, p);
for(double t = 0; t <= 1; t += dt)
{
vector<double> vt(4);
vt[3] = 1;
vt[2] = t*vt[3];
vt[1] = t*vt[2];
vt[0] = t*vt[1];
int x = round(DotProduct(xCof,vt));
int y = round(DotProduct(yCof,vt));
if(t==0)
{
MoveToEx(hdc,x,y,NULL);
SetPixel(hdc, x, y, color);
}
else LineTo(hdc,x,y);
}
DeleteObject(p);
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.