C :: Check How Many Colors Terminal Supports

Feb 17, 2013

I'm generating all ncurses color pairs like this

Code:

void generate_all_color_pairs(){ int foreground;
int background;
int i = 0;
for(foreground=0; foreground<8; foreground++){
for(background=0; background<8; background++){
i++;

[code]....

but according on several sources, some terminals suport more colors.Is there any way to determine how many colors the current terminal supports?

View 3 Replies


ADVERTISEMENT

C++ :: Any Header File That Supports 256 Bit Integer

Oct 18, 2014

Is there any header file that supports 256 bit integer?

View 4 Replies View Related

C :: Strings To Be Printed In Different Colors

Aug 21, 2013

I am currently using Dev-C++ 4.9.9.2 compiler for creating a C project. I need few strings to be printed in a different color.

Code:
#include<stdio.h>
#include<conio.h>
int main(void)
{ textcolor(RED);
cprintf("Hello world
");
system("pause");
}

While I use " textcolor(RED) " it says: 'RED' undeclared, first use in this function.

If i make it: " textcolor(3) ", it says: [Linker error] undefined reference to textcolor & undefined reference to cprintf.

have been searching for a solution on google since morning. At last I could make out that it is not the correct compiler with suitable library or outdated <conio.h> header file.

I had switched from turbo(or borland, I don't remember) to Dev-C++ compiler due to some kind of library issue. Now I guess I'll have to switch to some other IDE. Which one is that, I don't know yet. There was another thread also about this topic, but didn't provide any solution.

Is there any method to upgrade certain header file (I don't think so)? What would be the best IDE with updated libraries?

View 7 Replies View Related

C++ :: How To Draw Lines With Different Colors

Nov 8, 2014

I want to write a function called DrawLineSegments.This function must change the color of lines at every corner where the corner angle is greater than 60 deg (Assume that there is a function called checkangle). The color sequence must be black, red, green, blue, and repeat this sequence after the fourth color.

View 1 Replies View Related

C# :: Colors - Integer Value For Alpha

Jul 14, 2014

I want to use a new color for BaseColor in iTextSharp.

I can easily set a new color using RGB values from 0 to 255.

However, if I want to adjust the alpha value (and I know alpha ranges from 0 to 1), I can't make the alpha 0.5 because it's not an integer in the definition of BaseColor.

public BaseColor(int red, int green, int blue, int alpha);

So I can set my BaseColor like below:

static BaseColor newColor = new BaseColor(192, 192, 192);

but I can't use a non-int value for alpha. How can I easily convert double alpha values to integer values? What would be the range for alpha in int values and how do I, e.g., set the alpha value to 0.5 in int values?

EDIT: btw, I found online something like this: int alpha = (pixel >> 24). I don't understand why 24 and how can I break that into chunks I understand?

View 5 Replies View Related

C++ :: Detect Colors In The Black Rectangle?

Oct 5, 2013

I want to detect colors that in the black rectangle. [URL] How can I do? What library should I use?

View 7 Replies View Related

C# :: Manipulating Images Colors With ColorMatrix?

Feb 6, 2015

I found this elegant looking code on the net that claims to be able to manipulate an images colors using ColorMatrix.

When I run it, it does nothing! I used the code exactly as is with no editing, except to feed it my own image to do its work.

private void ApplySaturation(float saturation) {
float rWeight = 0.3086f;
float gWeight = 0.6094f;
float bWeight = 0.0820f;
float a = (1.0f - saturation) * rWeight + saturation;

[code].....

View 8 Replies View Related

C++ :: Make Colors Transparent Using 3rd Party Library

Jan 19, 2014

I'm trying to make colors transparent in c++ using a 3rd party library. I've successful made my background transparent but I feel I'm cheating by not understanding how I entered the value.

"0xff, 0xff, 0xff" is the color white but i'm not sure how it's the color white like with RGB values.

View 5 Replies View Related

C++ :: Assigning Colors To Individual Characters In Array?

Aug 31, 2014

Basically I am making a console RPG (isn't every beginner nowadays?) and I am having an incredible amount of trouble assigning specific characters their own color. e.g. monsters being red, cash being green, etc.

I took out Left, Right, and Down controls because of character constraint.

#include <iostream>
#include <windows.h>
//%%%%%%%%%%%%%% COLOR CALL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void setcolor(unsigned short color) {
HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hcon,color);

[code]....

View 8 Replies View Related

C++ :: How To Hide Console Or Terminal

Jul 2, 2013

I want to hide a terminal appliction or console application without using WinAPI programming or <windows.h> or something like "ShowWindow(hwnd_win,SW_HIDE);

View 19 Replies View Related

C++ :: Can't Open A Directory In Terminal

Jan 12, 2015

Taking a OS course and my professor gave us files to reference in a directory located at ~agw/class/os/share/proj3. But when I typed this into the terminal I keep getting a permission denied error message.

[lastname@erdos ~]$ ls
dead.letter Desktop Documents Downloads Music Pictures private Public public_html Templates Videos
[lastname@erdos ~]$ ~agw/class/os/share/proj3
/u/sobolev/agw/class/os/share/proj3: Permission denied.
[lastname@erdos ~]$

I'm not sure what I am doing wrong. Ive opened shared directories for this class before and had no issues.

View 1 Replies View Related

C++ :: Cannot Open A Directory In Terminal

Dec 9, 2013

Taking a OS course and my professor gave us files to reference in a directory located at ~agw/class/os/share/proj3. But when I typed this into the terminal I keep getting a permission denied error message.

[lastname@erdos ~]$ ls
dead.letter Desktop Documents Downloads Music Pictures private Public public_html Templates Videos
[lastname@erdos ~]$ ~agw/class/os/share/proj3
/u/sobolev/agw/class/os/share/proj3: Permission denied.
[lastname@erdos ~]$

I've opened shared directories for this class before and had no issues.

View 2 Replies View Related

Visual C++ :: Moving Mouse Cursor To Certain Colors On Monitor

Apr 22, 2013

I am currently starting to attempt to make a program that can move my cursor to certain colors on my monitor. The problem is this seems like it will be 10x harder than I first thought.

View 4 Replies View Related

C++ :: Make Command In Bash Terminal

Nov 27, 2014

I've recently refreshed my mac by reinstalling the operating system. Uploaded the previous C and C ++ source scripts I was working with but when I go to compile them through the bash terminal it says command not found? Im not sure whats going because I thought that all the gcc files were already available? What am I messing here.

View 5 Replies View Related

C/C++ :: Running Multiple Terminal In Xcode

Oct 5, 2014

I am using Xcode to do c++ programming and I have a c++ code, with different input arguments. I want to achieve that in Xcode, I could run multiple simultaneous running of my c++ code. However, the current problem is that once one code finishes, its terminal window automatically closed and I do not have time to look at its result. Thus computer time is wasted. Is there a way to run multiple same c++ code with different arguments input?

View 6 Replies View Related

C++ :: Compile With Terminal From MyProject Folder?

Apr 6, 2015

my folder structure looks like this:

Code:

MyProject
| |
header source
| |
Dog.h,Functions.h Functions.cpp, Dog.cpp, main.cpp

How can I compile and run this program (what do I have to type in terminal) - I would like to compile and run it from MyPoject's directory

Code:

cd MyProject

View 14 Replies View Related

C++ :: Print To Console Contents Of A File Using Foreground Colors And Other Attributes

Jun 29, 2013

Suppose I have a txt file that I want the contents printed to the console in such a way that every five words are colored blue and the following five are red. How do I accomplish such a task? I am currently only able to print the contents of the file in regular color using ifstream.

View 1 Replies View Related

C# :: Customize Font Styles / Colors / Size In Custom Message Box

Jul 15, 2014

I made my own custom message/dialog box.

I have a template mock up view using xaml. I have a viewmodel that raises the message property. I binded the message property to a textblock inside my xaml.

Since my messages are different for every viewmodel I have.

E.g.in every viewmodel, I have something like

messagewindow.Message = "This is a new message";
dialogService.ShowDialog(Success, messageWindow);

In one of my messages, I want to make the font bold and different color for a specific message segment.

How can I do that without messing up with the other messages that inherit from the xaml or code behind?

Currently, I'm not using any code behind and a lot of the examples online I've seen use code behind and/or don't have dynamic message textboxes.

View 5 Replies View Related

C++ :: Make A Terminal For Website And BHXSpectre Recommended Cgi?

Nov 22, 2013

so i want to make a terminal for my website and BHXSpectre recommended cgi (which i love... c++ web design. just one more reason to not use any other language). anyways, im wondering how would i generate the html for the base of the terminal? ie just the window that i will be writing to

View 2 Replies View Related

C/C++ :: Creating Two Dimensional Terminal Based Game?

Apr 4, 2014

i am working on class project in which i have to save the tank from canon....imy tank is moving only when i press the moving key.. and after that i see blank screen what should i do to run my process when i am not pressing moving keys....

View 8 Replies View Related

C++ :: Create Process And Assign Pipe Terminal Like Stoudt

May 30, 2014

I have study that create a pipe and set a terminal of this pipe like a stdout of a process is a way to implement inter process comunication, but how can i do it in c++?

View 2 Replies View Related

C++ :: Make Terminal Screen Bigger In NCurses Program?

Jun 29, 2013

I wanted to make the terminal screen bigger in my NCurses program. Let's say if the defaults are 25 LINES and 80 COLS, I want to set them to 40 LINES and 120 COLS.

I've tried resizing all windows, but that did not work, because the actual terminal (console) was not resized. Then I found functions resizeterm and newterm, but they did not work. As far as my understanding goes resizeterm only updates NCurses information with the current configuration, while the window itself is not actually modified.

NCurses man page wrote:The function resizeterm resizes the standard and current windows to the specified dimensions

If I haven't made myself clear ( I sometimes make a mess of things... ), another example would be that I want my program to be fullscreen when I start it. Is this possible? It should be, I found a fullscreen NCurses program once, but the code was too confusing for me to understand.

Having read about things like SIGWINCH, I assume you must define a method for resizing the terminal screen yourself, I don't know where to start?

View 11 Replies View Related

C :: Count Lines In Input And Display Output In Terminal When Program Executed After Compilation

Feb 4, 2013

Code:

#include <stdio.h>
main() {
int c, n1;
n1 = 0;
while ((c = getchar()) != EOF)
if (c == '')
++n1;
printf("%d", n1);
}

I have a more complicated program I'm wishing to have display the output, however, to save some time I'm using an example of a shorter version. count the lines in input and display the output in terminal when ./program is executed after compilation. To count and compute lines, words and within arrays.

View 4 Replies View Related

C++ :: Absolute Path Reference - Open File And Print Contents To Terminal Window

May 12, 2014

I am trying to open a file and print the contents of the file to the terminal window. It works when I put the file right in the directory with the Solution but not if the file is out on my desktop and I use the full path. Here is the code:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int OpenFile(){
fstream SampleFile;

[Code] .....

View 5 Replies View Related

C++ :: SDL - Check For A Key That Is Hold Down?

Sep 13, 2013

I'm using SDL to try to create a Run and Shoot game. But I do not know how to check if a key is down while the user is HOLDING it.

I do know how to check if a key was pressed.

I have tried with the "event.key.keysym.sym" and "Uint8 *keystate = GetKeyState(NULL)" both worked to check if a key was down but I thought that the GetKeyState(); Function would even check when a key where HELD down

I want my player to move while holding down left or right arrow. So I did something like:

Code:

Uint8 *keystate = GetKeyState(NULL);
if (keystate[SDLK_RIGHT]) {
apply_surface(x++, y, player, screen);
}

How to check if a key is held down?

View 2 Replies View Related

C++ :: How To Check Which Variable Has No Value

Nov 12, 2013

I am writing a console program for a class. I have satisfied the assignment, but I want to clear up what is mostly a cosmetic problem. The program prints a form to the console and places the cursor at a location on the form where the user inputs data. The problem occurs when the user presses the enter key without entering data. The cursor goes to the beginning of the next line. If the user enters data after this, the program functions correctly. I want to know how I can reposition the cursor if the user enters no data.

This is the code that reads one of the values:

Code:

void getHousing(HANDLE screen, MonthlyBudget &inputBudget) {
placeCursor(screen, HOUSING_ROW, ACTUAL_COL);
cin >> inputBudget.housing;
while (!validateEntry(screen, inputBudget.housing)) {
placeCursor(screen, HOUSING_ROW, ACTUAL_COL);
cout << SEVEN_SPACES << endl;
placeCursor(screen, HOUSING_ROW, ACTUAL_COL);
cin >> inputBudget.housing;
}
}

validateEntry checks that the entered value is >= 0 SEVEN_SPACES is a string of seven spaces to cover up the previous entry.

View 3 Replies View Related







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