/********************************************************* * TRANSFORM A 2D FIGURE * * ------------------------------------------------------ * * This program transforms a sparrow into its French name,* * MOINEAU, with 50 intermediate views. * * ------------------------------------------------------ * * From "Graphisme dans le plan et dans l'espace avec * * Turbo Pascal 4.0 de R. Dony - MASSON 1990", page 211. * * * * Visual C++ program in API style By J-P Moreau, Paris. * *********************************************************/ //Import with associated file. #include #include #include #include #define nbdefor 50 // number of intermediate views #define LIM 44 // number of points (+1) in figure HDC hdc; RECT rect; HPEN hpen, hpenOld, WhitePen; //Functions used here of module Gr2D.cpp void Fenetre(double,double,double,double); void Cloture(int,int,int,int); void Bordure(); void MoveXY(double,double); void LineXY(double,double); //"home made" graphic commands for hdc environment used by above functions void DrawPixel(int ix,int iy) { //sorry, no other available command found Rectangle(hdc,rect.left+ix,rect.top+iy, rect.left+ix+2,rect.top+iy+1); } void Swap(int *i1,int *i2) { int it; it=*i1; *i1=*i2; *i2=it; } void DrawLine(int ix1,int iy1,int ix2,int iy2) { int i,il,ix,iy; float dx,dy; if (ix2