Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-04-2008, 05:52 AM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Sep 2006
Posts: 1
Question Need Help!


I need C code to save the output of the following program into a jpg file(any picture file)?

i need to save the output of this program in to a picture file..i need to take printouts of those output..help me with the code that does the above thing...

i executed this program using TURBO C++ 3.0 IDE..i got the output but i am not able to use the print screen option to capture the output(DOS window..a black one)...i need the output to printed...

this program is just a program to draw straight line using DDA algorithm
#include<graphics.h>
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
#define ROUND(a)((int)(a+0.5))
void dda(int,int,int,int);
void main()
{
int gdriver=DETECT,gmode;
int x1,y1,x2,y2;
initgraph(&gdriver,&gmode,"c:\\tc\\bgi...
printf("Enter the starting and ending coordinates of line:");
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
dda(x1,y1,x2,y2);
getch();
}
void dda(int xa,int ya,int xb,int yb)
{
int dx,dy,steps,k;
float xinc,yinc,x,y;
dx=xb-xa;
dy=yb-ya;
if(abs(dx)>abs(dy))
steps=abs(dx);
else
steps=abs(dy);
xinc=dx/(float)steps;
yinc=dy/(float)steps;
x=xa;
y=ya;
putpixel(ROUND(x),ROUND(y),1);
for(k=1;k<=steps;k++)
{
x=x+xinc;
y=y+yinc;
delay(10);
putpixel(ROUND(x),ROUND(y),1);
}
}
vijayrock is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 09-04-2008, 09:52 AM   #2 (permalink)
In The Zone
 
ruturaj3's Avatar
 
Join Date: Feb 2007
Location: Mumbai
Posts: 214
Default Re: Need Help!

keep the dos window in normal state (not in maximized mode) & use the print screen.
ruturaj3 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:56 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2