#include #include #include #include #include #include /* se desen img. pozitiei se det nr de octeti necesari salvarii ei in memoria interna cu unsigned far imagesize() se salv img cu ajut fct. void far getimage(int x1,int y1,int x2,inty2, void far *z) delay se reface img respectiva cu void far putimage(int x,int y, void far *z,int op) unde op=COPY_PUT, XOR_PUT,AND_PUT,OR_PUT,NOT_PUT */ int gd,gm,x,y,pas,i,j, *pol; void latura(int x1, int y1,int x2,int y2,int x3,int y3,int x4,int y4); float rotplan1(int xc,int yc,int x1,int y1,float n); float rotplan2(int xc,int yc,int x1,int y1,float n); void main(void) { clrscr(); //cleardevice(); randomize(); void *p; printf("Pasul"); scanf("%d",&pas); pol[0]=120; pol[1]=70; pol[2]=160; pol[3]=145; pol[4]=70; pol[5]=95; pol[6]=170; pol[7]=95; pol[8]=80; pol[9]=145; pol[10]=120; pol[11]=70; detectgraph(&gd,&gm); initgraph(&gd,&gm,"C:\\borlandc\\bgi"); cleardevice(); setcolor(pas%16); setfillstyle(2,BLUE); fillpoly(6,pol); p=malloc(imagesize(70,70,120,120)); getimage(70,70,170,145,p); cleardevice(); i=0; for (j=0;j<100;j++) { i+=pas; putimage(10+i,10+i,p,OR_PUT); delay(50); putimage(10+i,10+i,p,OR_PUT); putimage(500-i,300-i,p,AND_PUT); delay(50); putimage(500-i,300-i,p,AND_PUT); putimage(10+i,300-i,p,COPY_PUT); delay(50); putimage(10+i,300-i,p,COPY_PUT); putimage(500-i,10+i,p,XOR_PUT); delay(50); putimage(500-i,10+i,p,XOR_PUT); if (i==400) i=0; } getch(); // closegraph(); } void latura(int x1, int y1,int x2,int y2,int x3,int y3,int x4,int y4) { moveto(x1,y1); lineto(x2,y2);lineto(x3,y3);lineto(x4,y4);lineto(x1,x1); } float rotplan1(int xc,int yc,int x1,int y1,float n) { float x; x=xc+(x1-xc)*cos(n)-(y1-yc)*sin(n); return x; } float rotplan2(int xc,int yc,int x1,int y1,float n) { float y; y=yc+(x1-xc)*sin(n)+(y1-yc)*cos(n); return y; }