Курсовая работа: Програмний комплекс для роботи розробки візитних карток
m.showmouseptr();
}
void saveimage(int x1,int y1,int x2,int y2,char filename[])
{ int ch,width,height;char c2;
ofstream outfile(filename);
outfile<<x2-x1<<endl<<y2-y1<<endl;
for(int a=x1;a<=x2;a++)
{ for(int b=y1;b<=y2;b++)
{ ch=getpixel(a,b);
outfile<<(char)(ch+28);
}
}
outfile.close();
}
void loadimage(int x1,int y1,char filename[])
{
char c2;int width,height,ch;
ifstream infile(filename);
if(infile)
{
setviewport(100,50,635,450,1);
infile>>width>>height;
for(int a=0;a<=width;a++)
{ for(int b=0;b<=height;b++)
{ infile.get(c2);ch=(int)c2;
putpixel(a+x1-100,b+y1-50,ch-28);
}
}
setviewport(0,0,639,479,1);