I have written this code to genrate a grapgh on the screen . I m not able to take the print of this. I hv tried the print screen but no use . Pls help me to solve this problem
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
void main()
{
clrscr();
int gd=DETECT, gm;
initgraph(&gd, &gm," ");
int userpat=1;
int x1,y1,y2,x2;
cout<<"Enter the coordinates of line";
cin>>x1>>y1>>x2>>y2;
setlinestyle(DOTTED_LINE,userpat,2);
line(x1,y1,x2,y2);
getch();
closegraph();
}
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<fstream.h>
void main()
{
ofstream outfile;
outfile.open(" dottedoutput.txt");
clrscr();
int gd=DETECT, gm;
initgraph(&gd, &gm," ");
int userpat=1;
putpixel(100,100,8);
int x1,y1,y2,x2;
cout<<"Enter the coordinates of line";
cin>>x1>>y1>>x2>>y2;
setlinestyle(DOTTED_LINE,userpat,2);
line(x1,y1,x2,y2);
getch();
closegraph();
//outfile<<initgraph(&gd, &gm," ")<< " \t"<< endl;
outfile.close();
}
Thanks for sugestion i will try.
If i try on borland C ++ compiler then will it give me result.
I means will the method to print will be the print screen or somthing else code is written above.