Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack (1) Thread Tools Search this Thread Display Modes
Old 18-04-2007, 10:06 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
In The Zone
 
Join Date: Jul 2005
Location: come on u know it
Posts: 428
Question URGENT:Print Screen of output in Turbo C


hello ,
anybody can help me urgently plz.
i have already complete a code using Turbo C.i'm now doing
the documentation for my project. i'd like to print screens of the output from turbo C and paste it in Paint but the bottom PrintScreen SysRq in the keyboard doesn't do the job i want. so what shall i do?
anybody can help me plz.

THANX A LOT
NagpurDaMunda is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 18-04-2007, 10:27 PM   #2 (permalink)
Fresh Stock Since 2005
 
Join Date: Feb 2005
Posts: 1,015
Default Re: URGENT:Print Screen of output in Turbo C

Quote:
Originally Posted by NagpurDaMunda
hello ,
anybody can help me urgently plz.
i have already complete a code using Turbo C.i'm now doing
the documentation for my project. i'd like to print screens of the output from turbo C and paste it in Paint but the bottom PrintScreen SysRq in the keyboard doesn't do the job i want. so what shall i do?
anybody can help me plz.

THANX A LOT
Yeah, I have to do the same too (i mean submit a report and i think i shud also give a presentation of my project)... so i needed this tooo..

However, i have figured out an idea to do it....

Compile your project and copy it to a bootable floppy (or floppy image if you dont have a floppy drive dont wish to use one). Then, boot into a Virtual Computer (VMware Beta 6 from VMware.com beta downloads) and then record video or take pictures.....


If you cant figure out, do let me know...
__________________
http://www.khattam.info

Last edited by khattam_; 18-04-2007 at 10:35 PM.
khattam_ is offline  
Old 18-04-2007, 10:31 PM   #3 (permalink)
In The Zone
 
Join Date: Jul 2005
Location: come on u know it
Posts: 428
Default Re: URGENT:Print Screen of output in Turbo C

sorry but i didnt get u
NagpurDaMunda is offline  
Old 19-05-2009, 07:33 AM   #4 (permalink)
Right Off the Assembly Line
 
Join Date: May 2009
Posts: 1
Default Re: URGENT:Print Screen of output in Turbo C

you can use this cpp code in your program to capture that graphic image
//Here is a program to save a graphical o/p to bmp
#include<graphics.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>

int SaveBMP16(char []);
typedef unsigned char byte;
typedef unsigned int word;
typedef unsigned long dword;
void main()
{
/* request auto detection */
int gdriver;
int gmode, errorcode;
detectgraph(&gdriver,&gmode);
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");

errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
exit(1);


int midx, midy,radius = 100;

midx = getmaxx() / 2;
midy = getmaxy() / 2;

setcolor(getmaxcolor());

/* draw the circle */
circle(midx, midy, radius);

/* clean up */
SaveBMP16("Circle.Bmp");
}

struct BMP
{

// BitMap File Header
byte bfType[2]; /* 1 2 must always be set to 'BM' to declare that this is a .bmp file.*/
dword bfSize; /* 3 4 specifies the size of the file in bytes.*/
word bfReserved1;// 7 2 must always set to zero. */
word bfReserved2;// 9 2 must always be set to zero.
dword bfOffset; // 11 4 specifies the offset from the beginning of the file to bitmap data.

// BitMap Image Header
dword biSize; // 15 4 specifies the size of the BitMap Header structure, in bytes.
dword biWidth; // 19 4 specifies the width of image, in pixels.
dword biHeight; // 23 4 specifies the height of image, in pixels.
word biPlanes; // 27 2 specifies the number of planes of the target device,must be set to 0
word biBitCount; // 29 2 specifies the number of bits per pixel.
dword biCompression; //31 4 Specifies the type of compression, usually set to 0 - No Compres
dword biSizeImage; // 35 4 specifies the size of the image data, in bytes. If there is no compression, it is valid to set this member to zero.
dword biXPelsPerMeter; //39 4 specifies the the horizontal pixels per meter on the designated targer device, usually set to zero.
dword biYPelsPerMeter; // 43 4 specifies the the vertical pixels per meter on the designated targer device, usually set to zero
dword biClrUsed; // 47 4 specifies the number of colors used in bitmap, if set to 0 number of colors is calculated using the biBitCount member.
dword biClrImportant; // 51 4 specifies the number of color that are 'important' for the bitmap, if set to zero, all colors are important.
};


int SaveBMP16(char file[])
{
int i=0, j=0, r, g, b;

FILE *fp;
BMP *bmp;

bmp=(BMP *)malloc(54);

bmp->bfType[0]='B';
bmp->bfType[1]='M';
bmp->bfSize=153718;
bmp->bfReserved1=0;
bmp->bfReserved2=0;
bmp->bfOffset=118;
bmp->biSize=40;
bmp->biWidth=640;
bmp->biHeight=480;
bmp->biPlanes=1;
bmp->biBitCount=4;
bmp->biCompression=0;
bmp->biSizeImage=153600; //Fixed Size ?
bmp->biXPelsPerMeter=0;
bmp->biYPelsPerMeter=0;
bmp->biClrUsed=0;
bmp->biClrImportant=0;

fp=fopen(file, "wb");
if(fp == NULL)
{
printf("File can't be open");
getch();
return 1;
}


fwrite(bmp, 54, 1, fp);
fseek(fp, 54L, SEEK_SET);

// Upto Here its OK.


// Question 1. What do next 16x4 Lines do ?

fputc(0x0, fp);
fputc(0x0, fp);
fputc(0x0, fp);
fputc(0x0, fp);

fputc(127, fp);
fputc(0x0, fp);
fputc(0x0, fp);
fputc(0x0, fp);

fputc(0x0, fp);
fputc(127, fp);
fputc(0x0, fp);
fputc(0x0, fp);

fputc(127, fp);
fputc(127, fp);
fputc(0x0, fp);
fputc(0x0, fp);

fputc(0x0, fp);
fputc(0x0, fp);
fputc(127, fp);
fputc(0x0, fp);

fputc(127, fp);
fputc(0x0, fp);
fputc(127, fp);
fputc(0x0, fp);

fputc(0x0, fp);
fputc(192, fp);
fputc(192, fp);
fputc(0x0, fp);

fputc(192, fp);
fputc(192, fp);
fputc(192, fp);
fputc(0x0, fp);

fputc(128, fp);
fputc(128, fp);
fputc(128, fp);
fputc(0x0, fp);

fputc(255, fp);
fputc(0x0, fp);
fputc(0x0, fp);
fputc(0x0, fp);

fputc(0x0, fp);
fputc(255, fp);
fputc(0x0, fp);
fputc(0x0, fp);

fputc(255, fp);
fputc(255, fp);
fputc(0x0, fp);
fputc(0x0, fp);

fputc(0x0, fp);
fputc(0x0, fp);
fputc(255, fp);
fputc(0x0, fp);

fputc(255, fp);
fputc(0x0, fp);
fputc(255, fp);
fputc(0x0, fp);

fputc(0x0, fp);
fputc(255, fp);
fputc(255, fp);
fputc(0x0, fp);

fputc(255, fp);
fputc(255, fp);
fputc(255, fp);
fputc(0x0, fp);

i=0;
j=479;

fseek(fp, 118, SEEK_SET);

while(j>=0)
{
i=0;
while(i<640)
{
fputc((getpixel(i, j)<<4) | getpixel(i+1, j), fp); //Que 2. What does this do ? Why Left Shift 4 times and why Bit wise ORing of two pixles.
i+=2;
}
j--;
}
free(bmp);
fclose(fp);
return 0;
}

Quote:
Originally Posted by NagpurDaMunda View Post
hello ,
anybody can help me urgently plz.
i have already complete a code using Turbo C.i'm now doing
the documentation for my project. i'd like to print screens of the output from turbo C and paste it in Paint but the bottom PrintScreen SysRq in the keyboard doesn't do the job i want. so what shall i do?
anybody can help me plz.

THANX A LOT
kuldhirsingh is offline  
Old 19-05-2009, 07:57 AM   #5 (permalink)
Call me D_J!
 
Disc_Junkie's Avatar
 
Join Date: Nov 2008
Location: INDIA
Posts: 866
Default Re: URGENT:Print Screen of output in Turbo C

Quote:
Originally Posted by NagpurDaMunda View Post
hello ,
anybody can help me urgently plz.
i have already complete a code using Turbo C.i'm now doing
the documentation for my project. i'd like to print screens of the output from turbo C and paste it in Paint but the bottom PrintScreen SysRq in the keyboard doesn't do the job i want. so what shall i do?
anybody can help me plz.

THANX A LOT
The Print Screen key does work there but not for paint but for Text Editors... The black screen is changed to white and the text is changed to black. You'll get to see it when you paste in Notepad or any other text editor...
__________________
ASUS K42JA-VX032D RAWKS !!!!!!:grin:
Disc_Junkie is offline  
Old 19-05-2009, 08:50 AM   #6 (permalink)
Wise Old Owl
 
speedyguy's Avatar
 
Join Date: Aug 2004
Location: Bangalore/Jamshedpur
Posts: 1,173
Default Re: URGENT:Print Screen of output in Turbo C

take a screen shot of the output wen not in full screen mode(if not a graphics code) n cutout the dos part in paint...

Enjoy~!
__________________
No Pain...No Gain
speedyguy is offline  
Old 19-05-2009, 11:46 AM   #7 (permalink)
Alpha Geek
 
paroh's Avatar
 
Join Date: Jul 2008
Posts: 781
Default Re: URGENT:Print Screen of output in Turbo C

Simply use dosbox emulator and u can print the screen
See my this post (VIDEO Tutorial is also uploaded) how to set the setting to run dosbox

Code:
http://www.thinkdigit.com/forum/showthread.php?t=103652&highlight=dosbox

Last edited by paroh; 19-05-2009 at 12:02 PM.
paroh is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


LinkBacks (?)
LinkBack to this Thread: http://www.thinkdigit.com/forum/qna-read-only/55464-urgent-print-screen-output-turbo-c.html
Posted By For Type Date
Thread How to take printouts of Graphics in c using TURBO C 3.0 ? | Digit Forum | BoardReader This thread Refback 27-07-2010 07:03 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Output Screen In C++ ! BBThumbHealer Programming 7 08-03-2009 06:10 PM
PRINT SCREEN AT COMMAND PROMPT vikramjain Software Q&A 1 02-04-2006 05:36 AM
Green Screen In Media Player 10 !??????????? Help Urgent !!! Chindi_Chor Software Q&A 11 24-03-2006 11:38 PM
urgent help how to print .lwp file? shrohit QnA (read only) 2 21-12-2005 06:49 PM

 
Latest Threads
- by Tenida
- by Charan
- by abhidev

Advertisement




All times are GMT +5.5. The time now is 09:59 AM.


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

Search Engine Optimization by vBSEO 3.3.2