943,536 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1573
  • C++ RSS
Nov 6th, 2008
0

Using cout with graphic screens

Expand Post »
If I initialize graphics in my program and then use cout the font appears bigger than normal and the cursor doesn't blink on the screen as it does when the graphics are not initialized.Is there any way I can use graphics as well as cout in my program?If yes how to do that.
Reputation Points: 53
Solved Threads: 33
Posting Whiz in Training
bugmenot is offline Offline
224 posts
since Nov 2006
Nov 6th, 2008
0

Re: Using cout with graphic screens

Just a though but you may need to be a little be more specific when you say graphics... also i would suggest pasting some sample code, that demonstrates the problem

Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Nov 6th, 2008
0

Re: Using cout with graphic screens

Click to Expand / Collapse  Quote originally posted by bugmenot ...
If I initialize graphics in my program and then use cout the font appears bigger than normal and the cursor doesn't blink on the screen as it does when the graphics are not initialized.Is there any way I can use graphics as well as cout in my program?If yes how to do that.
Which graphics library are you using? I wouldn't think cout would work with any windows graphics lib, since it's for streaming to the console. But apperantly I'm wrong?
Reputation Points: 352
Solved Threads: 108
Master Poster
skatamatic is offline Offline
772 posts
since Nov 2007
Nov 7th, 2008
0

Re: Using cout with graphic screens

Click to Expand / Collapse  Quote originally posted by bugmenot ...
If I initialize graphics in my program and then use cout the font appears bigger than normal and the cursor doesn't blink on the screen as it does when the graphics are not initialized.Is there any way I can use graphics as well as cout in my program?If yes how to do that.
Hi,

There are two modes of programming in Borland C++.

1. text mode
2. graphics mode.

In text mode, we have 80 columns and 50 rows in windows xp but in graphics mode, we have 640 columns and 480 rows.
Every mode has its own define functions. We cannot use text mode function and graphics mode similarly, its opposite is too.

"cout " works only in text mode. It cannot be used in graphics mode instead you have to use graphics function to print some text in graphics mode.

try this function in graphics mode. outtextxy(x,y,"string to write");

C++ Syntax (Toggle Plain Text)
  1.  
  2. int x = 300;
  3. int y=200;
  4. outtextxy(x,y,"Hello World");
  5.  
  6. //output:- The text will be printed approximately in the center of the graphic mode screen


--
Regards,
Asif
Reputation Points: 10
Solved Threads: 0
Light Poster
asifjavaid is offline Offline
40 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Help with a rot13 encrypter
Next Thread in C++ Forum Timeline: [Borland C++ Builder] ListBox Multiple Selection





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC