C/C++ :: How To Give A Color To The Text That Displayed In Output Screen

Jan 27, 2013

i am using c++v30.5 version i want red color text in in my output screen . i viewed various site but the result is 0 ,wat to do?

View 2 Replies


ADVERTISEMENT

C++ :: Clear Screen In Console - Change Text Color In EXE

Dec 28, 2013

How I can clear the whole screen in console...

And I'm using clrscr(); and its not working.

How i can change the text color in the .exe without using system function

View 4 Replies View Related

Visual C++ :: How To Determine If A Metro App Is Currently Displayed On The Screen

Apr 22, 2014

I'm trying to determine (from my Win32 process) if a Metro (or a Modern UI) app is currently displayed on the screen. I found the IAppVisibility::GetAppVisibilityOnMonitor method that can do just that, and I even found a C++ sample, but my issue is that I'm compiling it with the Visual Studio 2008 that does not have the definitions for the IAppVisibility interface, so the following:

Code:
#include <Shobjidl.h> //Earlier version
IAppVisibility* pAppVis = NULL;
HRESULT hr = CoCreateInstance(CLSID_AppVisibility, NULL, CLSCTX_INPROC_SERVER,
IID_IAppVisibility, (void**) &pAppVis);

Results in a set of errors:

Code:
error C2065: 'IAppVisibility' : undeclared identifier
error C2065: 'IID_IAppVisibility' : undeclared identifier

how to define them?

View 4 Replies View Related

C++ :: Give Appropriate Color Code For Resistor After User Input

Sep 18, 2013

I am in the process of writing a program that will give the appropriate color code for a resistor after the user enters an integer value for the resistance needed and selects the tolerance form a list. My question is this: Is there a way to allow the user to enter a value such as 75000 and C++ use each digit separately, as if they entered 7 [enter], 5[enter], 0 [eneter]... and so on? But, then use the entire value as an integer too? Also, it should read a value such as: 45835, as 45000, or 1843 as 1800.

View 1 Replies View Related

C++ :: Data Is Not Being Displayed In Text Box?

Oct 22, 2013

why my data is not being displayed in my text box. I have no compiling errors and it seems as if my program isnt doing anything.

Here is my code:

#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>

[Code].....

View 4 Replies View Related

C++ :: Give Output To Child Process

Apr 15, 2012

I'm trying to build a basic shell for Unix. This is the code I use to create a new process:

Code:
pid = fork();
if (pid == 0) {
setpgrp();
complexCommand(argv, isComplex);

[code] .....

Where complexCommand is a function that handles the command (uses execvp after generating the correct string out of argv). My problem is that after if while in the shell I use a program that needs to print to the screen and handle input, it doesn't work as expected. To test this, I built this small program:

Code:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main() {
int x1, x2;

[code] ....

And when I use the shell I built to run it, the output is only "Enter 2 numbers" for one time. It doesn't print the result, or anything else. Is there anything I need to do in the parent process (my shell in this case) to give the child the output?

View 2 Replies View Related

C++ :: Add And Minus From Text File Not Give Right Value

Feb 5, 2014

I'm creating a bank system.

So I know to make a deposit to the balance, which add ups what is the balance to i have add.

When i run the deposit function, its work well in some ways. If balance(text file) has the value 10, add i addSum 20, the balance will become 30, same as the text file will become 30. so its work well to add positive number.

Code:
double deposit(double balance) {
double addSum = 0;
system("CLS");
cout<< "Welcome to deposit."<<endl;
cout<<"Enter a sum you wish to add to your account:";

[code]...

When I withdraw from 30 which is the balance, then i takeSum, for example i take away 30. The balance will become 30 - 30 = 0 When i make another withdraw from example -150, it will be -150.Which shows correct.

But when i make a deposit from -150 and i addSum 130, the balance shows -500, and it should had been -20.

Code:
double withdraw(double balance) {
double takeSum = 0;
system("CLS");
cout<< "Welcome to withdraw."<<endl;
cout<<"Enter a sum you wish to take away from your account:";

[code]...

View 2 Replies View Related

C/C++ :: Color Conversion - Skewed Output

Mar 29, 2014

What the issue is with my algorithm, though it seems to match others that are out there. I believe the output is wrong for what it should be.

Input:

50 50 50
0 0 0
255 255 255
0 100 100
200 200 0
150 0 150
300 0 0
1 1 1
0 0 245

Code:

#include <iostream>
#include <fstream>
using namespace std;
void isValid(int, int, int);
float maximum(float, float, float);
void RGBtoCMYK(float, float, float, float &, float &, float &, float &);

[Code] .....

Output:

0 0 0 0.803922
0 0 0 1
0 0 0 0
1 0 0 0.607843
0 0 1 0.215686
0 1 0 0.411765
0 1 1 -0.176471
0 0 0 0.996078
1 1 0 0.0392157

View 8 Replies View Related

C++ :: Output String Depending On Color Detected In A Frame Video Feed

Jul 18, 2014

what I'm trying to do is output a certain string depending on the color I see in the video feed. For right now, what I've done is threshold the feed so that everything above a certain brightness shows up as Red. Now I want to have something that says if there's any red in the feed, then I output a "1" to a text box on my user interface that's showing the feed. If there is no red, then I output a "0" to the text box.

I'm using Emgu CV C ++ with VS2010.

This is the code I have so far that isn't working correctly, it's giving me a compiler error.

cvConvertScaleAbs(frameFromCamera->Ptr.ToPointer(),frameDisplay->Ptr.ToPointer(),double(1)/16,0);
cvCvtColor(frameDisplay->Ptr.ToPointer(),frameColorDisplay->Ptr.ToPointer(),CV_GRAY2BGR);
cvThreshold(frameDisplay->Ptr.ToPointer(),maskSaturated->Ptr.ToPointer(),200,255,CV_THRESH_BINARY);

[Code] .....

and the error it's giving me

BAOTFISInterface.cpp(1010): error C2664: 'Emgu::CV::Image<TColor,TDepth> ^Emgu::CV::Image<TColor,TDepth>::InRange(Emgu::CV::Image<TColor,TDepth>
^,Emgu::CV::Image<TColor,TDepth> ^)' : cannot convert parameter 1 from 'Emgu::CV::Structure::Bgr *' to 'Emgu::CV::Image<TColor,TDepth> ^'

[Code] .....

Build FAILED.

View 1 Replies View Related

C++ :: Color Change Of Text More Than Once In Program?

Jan 13, 2014

How do i change color of text in the program more than once . rite now i use the code

system ("color 0c");//makes the color of the text red
cout <<"hey";
system ("color 02") //change color to green;
cout<<"only in green ";

it displays both the lines in green not the first in red and second in green.

View 1 Replies View Related

C/C++ :: Change Color Of The Text And Background

Jul 7, 2014

I was trying to change the text and background color to :red blue

Is there a way to do this? is there a certain function? ...

View 1 Replies View Related

C++ :: Output Displaying Out Of The Screen

Feb 11, 2014

I have turbo c++ on windows xp SP2.....whenever i compile my code in turbo c++ i am getting output outside the screen.....but when i used code::block....i get the correct output...fits to screen ...

View 7 Replies View Related

C# :: Can't Output Ounces On Screen

Jun 25, 2014

why I can't output ounces on the screen in c#...here's the code:

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Chapter7Problem12
{
class Program
}

[code]....

View 6 Replies View Related

C++ :: Odd And Even Integers - How To Output On Screen

Apr 18, 2013

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
int main()

[code]....

I do not know how to output on the screen, I believe that i have written it to the file correctly but i dont know how to output it.

View 1 Replies View Related

C++ :: How To Show Output On Screen

Oct 29, 2013

I want to write a program that makes this output to appear on screen using for-loop :

0 0
1
2
3
4
5

1 0
1
2
3
4
5

2 0
1
2
3
4
5

3 0
1
2
3
4
5

I can't seem to make the correct logic/engine of this nested loop.

View 11 Replies View Related

C/C++ :: How To Align Output Screen

Feb 2, 2014

I managed to write successfully my code that I have been wanting to write for some years now, but I want to align the text that is displayed in the output screen but I haven't been able to. I've tried adding and taking away numbers from the identifiers but nothing.

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#define ARRAYSIZE 2
#define FORMAT "First Name Pago1 Pago2 Pago3 Pago4 Total Net"
#define FORMATHEADER "Last Name "

[code].....

View 1 Replies View Related

C/C++ :: Changing Text Color Of Only One Line Of Console?

May 13, 2014

I try to change the text color of console in C++. I know some commands like .

system("color fg");

But I want to change the color of only one line of console. Is this possible?

View 4 Replies View Related

C++ :: How To Change Cell Text Color In QTableView

Jul 24, 2013

I've tried this (without success):

ui->tableView->model()->setData(ui->tableView->model()->index(5, 5, QModelIndex()), QVariant(QColor(Qt::red)), Qt::DecorationRole);

View 6 Replies View Related

C++ :: How To Display Image On Output Screen

Nov 21, 2013

how to display an image on the output screen of c++ program.

I am using : Turbo c++(dos box) on win8

View 1 Replies View Related

C++ :: Data File Output To Screen

Oct 13, 2013

I am having trouble outputting the file "output1.dat" to the screen. here is my code -

#include <fstream>
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
//Outputs a description of what this program does
void intro();
void sort_merge(ifstream& in_1, ifstream& in_2, ofstream& out_1 );

[Code] .....

View 2 Replies View Related

Visual C++ :: Change Text And Background Color Of CComboBox?

Nov 26, 2014

I have a derived CComboBox class, where I tried to change text and background of edit from CComboBox, just like this:

Code:
HBRUSH CMyComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) {
HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
//if(CTLCOLOR_EDIT == nCtlColor || CTLCOLOR_MSGBOX == nCtlColor) {

[Code] ......

but is not working if CComboBox has CBS_DROPDOWNLIST style ... is working only for CBS_DROPDOWN style ... why ?

View 10 Replies View Related

C++ :: Make Output Print Out To Screen In Reverse?

May 26, 2013

How can I make the output print out to the screen in reverse?

Code: #include <iostream>
#include <iomanip>
using namespace std;
int getnum();
void Fibonacci(int n);

[Code].....

View 7 Replies View Related

C/C++ :: Tic Tac Toe - Initialize Arrays At Zero And Output Board To Screen

Sep 13, 2014

/* This is what I have so far what i am trying to do is to initialize the arrays at zero and output the board to the screen. Part of the problem is the user has the option of the board size. All this is suppose to do is to output the board to the screen. I am having problems understanding 2D Arrays.
*/

using namespace std;
int main() {
const int BOARD_MAX = 10; // Maxinum Board size.
const int BOARD_MIN = 3; // Minimum Board size.
array = [COL];
array [ROW];

[Code] ....

View 5 Replies View Related

Visual C++ :: Change Default Text Attributes (font And Color)

Nov 12, 2013

I needed to change Default Text attributes (font and color) . So I wrote following code , UnicodeTextOut function. I called this function once in each 55ms to update the display screen. but I observed that my Screen used to become grey like a crash after sometime . If I use Minimize an Maximize window , the screen was restoring back for some time.

When I thought over the code , I got my mistake that CreateFont initialization should be done once in the program and probably outside the function.

void UnicodeTextOut(int x, int y, CString s, UINT justify,int GreyScaleFlag) {
HFONT hFontUnicode;
HFONT hfOld ;
hFontUnicode = CreateFont(16, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, _T("Aerial"));

[Code] ....

Then I shifted the line hFontUnicode = CreateFont(16, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, _T("Aerial")); in my screen class constructor and made hFontUnicode global .

This solved my problem as expected. Why a system crash after certain no of CreateFont calls ?

View 2 Replies View Related

Visual C++ :: Basic Settings - How To Configure Color Of Selected Text

May 4, 2014

How to configurate color of selected text. I am not sure why, but in Visual C++ it is not displayed as in other programs like notepad, which should be harder color. So I cannot find the selected text. Where can I configurate it or where to search it in desktop theme settings?

View 3 Replies View Related

C :: How To Prevent A User From Closing Output Screen During Execution

Sep 17, 2013

I created a C program that extracts some information from computer and displays it on screen. It is completed today and is going to be applied to startup programs of domain machines. It runs at logon and takes somewhat 5-10 seconds to finish execution. The output is shown on console screen & user can either close the window by clicking on 'x' or pressing 'Ctrl+c' during execution. How do i prevent both of these events?

Basically the most time consuming processes are

Code: popen("systeminfo","r");
popen("wmic qfe get installedon","r");

1st command is getting OS name,version and hotfixes installed.
2nd command gives me the date of updates installed.

I then filter out data & print required information only.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved