C :: Editing Image In PPM Format

Mar 10, 2014

I'm trying to edit an image by multiplying the red component of each pixel by 10 and leaving the other components (green and blue) untouched. I'm not really sure how I'm supposed to edit the pixels one by one. I have this so far. I think there is something wrong with my ppm header as well. Is there a way to make a ppm header without specifying the bounds so that it conforms to the image you are putting in?

Code:

#include <stdlib.h>
#include <stdio.h>
#define PICTURE_FILE 1
#define MIN_ARGS 2
#define h 768
#define w 1024
void solve(FILE *in_picture, FILE *out_picture)

[Code] .....

View 6 Replies


ADVERTISEMENT

C :: Generating Histogram Of PGM Format Image

Jul 29, 2014

I need a C code for generating a Histogram with intensities at X-axis and number of pixels at Y-axis from a PGM format image.

View 5 Replies View Related

C++ :: How To Take Screenshot And Save It In Image Format

Jul 31, 2014

I want to take screen shot and save it in any image format like jpg, bmp, ppm or any other .

View 3 Replies View Related

C/C++ :: How To Save Entire Web Page As Image (JPEG Format)

Apr 17, 2014

I was trying to capture entire web screen and save as .jpeg format.

So far I have done this using C# Windows Application.

Same thing I am willing to do in 'VC++ 2010 Win32. In my C++ project I have created a Toolbar with a button on IE 9 browser. And on Toolbar button click I can print current window.

But I don't know how to take a snapshot and save to specified directory in .jpeg format using VC++ 2010. I have Windows 7.

View 4 Replies View Related

C :: Editing Text File

Jan 2, 2014

I have a problem editing a text file in c

Code:
#include <stdio.h>#include <stdlib.h>
#include <string.h>
typedef struct
{
char *name;
float gpa;

[Code] ....

View 3 Replies View Related

C++ :: Editing Certain Line In File?

Apr 16, 2013

Well,i hav a question requiring me to edit sales achieved by an employee for a particular month.

I'm having a dat.file which following format
Employee ID
Name
Sales(for a year)

For example
A00001
Harlem Shake
10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00 90.00 100.00 110.00 120.00

Wad I wanna is TO EDIT only the sales for July which is 70.00 to a new amount with other months remain intact.

I need to search particular id which will then link to their respective sales.

ofstream outFile;
string empID;
cout<<"Please Enter Employee ID:

[Code] ....

I tried to run myself before.But I could only create a new line instead of replacing.

To my understanding with ios::app ..will use the same file for editing..

View 4 Replies View Related

C++ :: Reading And Editing A File Bit By Bit

Dec 7, 2013

Basically what I am looking for is a way to get a block memory, copy it into ram in a format along the line of bit[#], replace the original with a new code that may or may not be the same size(they will be something to ensure does not try to save a fraction of a byte).

Is there an easy way to do this or do I just need to read work from a bin file?

View 3 Replies View Related

C/C++ :: Editing Vec3 Variables?

Sep 11, 2014

I have this function that takes the collision location from an object then creates a new object for particle effects.

This is one of the functions that is called when creating the particle,void Particles_Create(i32 iID, Vec3 &vecPos, i32 ProjectileType, i32 iNumberOfParticles, float fSpread, float fGrowSpeed, float fMaxSpeed, float fMaxSize, float fParticleTime);

I want to be able to change the "Vec3 &vecPos" variable, when I define the variable that goes into the function I've defined it as: "Vec3 vecPos;" if I define it as "Vec3 vecPos(float fvx,float fvy,float fvz);" the variable cant be fed into the function.

I cant change my function because its used elsewhere but I want to be able to change the x,y and z elements inside the Vec3 vecPos variable. How without redefining it as Vec3 vecPos(float fvx,float fvy,float fvz);

View 10 Replies View Related

C# :: Compare The Image Of A Button To Another Image In Visual Studio

Jul 3, 2014

Im trying to compare the image of a button to another image in Visual Studio like so...

//variables
Image active = Image.FromFile("C:\Users\Ethan\Desktop\StarWars Status\active.png");
Image stunned = Image.FromFile("C:\Users\Ethan\Desktop\StarWars Status\stunned.png");

[Code]...

btnStatusPlr1.Image SHOULD come back as True.Then I realized it might not be the same as setting the buttons image in the properties (Which is what i did to get the original image (the one being compared to))

I do have a feeling ive done something wrong here (Yes im a noob /> )

Variable active, is the same image as the buttons default (Well should be)

View 1 Replies View Related

C++ :: Editing Attribute Values With Libxml2?

Sep 6, 2014

I have tried googling, so, reddit, irc, and various other forums. Anyways, I am writing a todo list app in c. It generates an xml tree that looks something like this: [URL]... . The problem where I am struggling, is in the function todo_complete, I try to make the attribute of an item switch from false to true. it does it without error, but I can't make it stay that way. here is the code: [URL]...

View 3 Replies View Related

C# :: File Gets Locked For Editing When Use Openfiledialog

Oct 30, 2014

I have a button that opens a file dialog box so that a user can pick a file. I only need it for the path and file name to be passed to another program. I do not want to open the file or care about its contents. I just want the name and path.

private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();

[Code].....

The problem is that as long as the program is running the file that the user picked is locked for editing. Adding the Dispose() had no affect. Multiselect and ReadOnlyChecked have no affect. Only closing the application frees the file.

View 7 Replies View Related

C/C++ :: Editing String Values In Char

Mar 4, 2014

I have a char correctAns[100] which is empty when initialized. i want to make it hold a different string for each section, so i can use strcmp to compare the correctAns to the answer given by user. here is code

#include <stdio.h>
#include <string.h>
int main() {
char answer[100];
int checkAns;
char correctAns[100] , incorrectAns[100];

[Code] .....

View 1 Replies View Related

C# :: Microsoft Word Editing With Toolbars?

Dec 6, 2014

I'm trying to create a program for my wife to be able to browser through and edit folders and specifically word documents- really just a shiny organization tool without having to open up Word. I'll be integrating other functions into this program but Word is what I'm worried about.

At the moment I've been able to create a file browser with the ability to add and remove files within the main directory of the program. Basically just C:Users\%user%mainDirdata*

Within the data folder I have the main folders which will be displayed as tabs across the top and then any subfolders of the main folders will be displayed on the left side after you click on the main tab.

[URL]

I'd need the toolbars to be integrated into the program across the top and then a window that changes depending on the document selected on the left side based on the content of the word document located in that folder. I haven't been able to find anything online and I'm not really able to spend $800 on the alternates that look like they just do automation as well.

View 10 Replies View Related

C/C++ :: Reading And Editing ID3V1 MP3 Tags

Feb 25, 2014

I am trying to write a program that will read the id3v1 tag of an mp3 file, output the current information, and then allow the user to edit the ID3 tag. I can get it to output the information but I'm having some issues getting it to edit correctly. It seems to try to edit the wrong fields.

#include <iostream>
#include <fstream>
using namespace std;
int main(){
int end;
ifstream myInputFile;
myInputFile.open("01-Cheeseburger in Paradise.mp3", ios::in);

[Code] ....

View 8 Replies View Related

C/C++ :: Editing DLL File That Has Some Kind Of Timer

Oct 19, 2014

I have a .dll file that is used by some kind of launcher. Now the .dll file has some kind of timer on it and after that set of time it wont let me use it, how i can edit that out of a .dll?

View 4 Replies View Related

C++ :: For Loop Theory For Tile Map Editing Program

Jul 10, 2013

Basically I have an tile class with the following variables: x, y, texture, and solid. I have created an array called tile MAP[map_tiles_x][map_tiles_y]. The object of the following snip-it of code is to loop through all of the tiles in the map placing their default values in each. For some reason this code does not work as planned, but in theory shouldn't it? I cannot see why it doesn't work. (BTW I do plan on open sourcing this map editor.

void init_map(){
for (int tile_y; tile_y < map_tiles_y; tile_y++){
for (int tile_x; tile_x < map_tiles_x; tile_x++){
MAP[tile_x][tile_y].x = tile_x * tile_size;
MAP[tile_x][tile_y].y = tile_y * tile_size;
MAP[tile_x][tile_y].solid = false;
std::cout << MAP[tile_x][tile_y].x << ", " << MAP[tile_x][tile_y].y;
} }

I should also add the effect of the code. Basically it only sets the default coordinates for the first object :/.

View 4 Replies View Related

C# :: Editing A Parent Dialog Box Without Closing The Child

Sep 30, 2014

I'm using windows forms and I have a parent dialog box that consists of a text box and a drop-down that launches a child dialog box. The child takes user input and then prints dialog to the text box in the parent. However, the output does not appear in the text box until I close the child.

Now my question is, how do I get the text to appear without closing the child? I hit a button to send the info to the text box, but it still doesn't appear until the child closes. I also need to set up a button to suspend the child so that the user can click/copy/etc the parent.

View 7 Replies View Related

C++ :: Editing Saved Records In A Text File?

May 19, 2012

i have this program that i am undertaking.....this project needs to store customer details, edit them and delete them...now i am facing the problem of deriving a code to edit those details...

MY CODE

HTML Code:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main () {
int choice [1];
string name;

[code].....

View 4 Replies View Related

C++ :: Inventory Control Application - Editing Text File

Nov 14, 2014

You are requested to create an inventory control application for a drink stall (give a name to the stall). The application is used to show the list of drinks the stall sells, how many of each item on‐hand and the cost of each item. The records are to be saved and retrieved to/from a binary file called “drinks.txt”. For each drink in the stall, your program is to keep the information as a Record Structure called DrinkRecord. The structure should at least consist of the following:

(1) Item Number
(2) Item Name
(3) Quantity
(4) Unit Price

Your application should have the following features:
(a) Display a drink information
(b) Add a new drink information
(c) Update a new drink information
(d) Delete a drink information
(e) Display all drink information

#include <string>
#include <fstream>
#include <vector>
#include <iterator>
#include <algorithm>
#include <stdlib.h>
#include <iomanip>

[code].....

Everything works fine with minor issues, but I'm having trouble with the editing function. I need to be able to search for a specific drink then be able to edit its contents and print the new contents to the file. I have not created a structure yet. I will do that as soon as possible.

View 1 Replies View Related

C++ :: Converting One Format To Another?

Apr 7, 2013

I am in a c++ class and my group is having a hard time making this work... It keeps saying that 'fileOne.open' isn't working.

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

[Code]....

View 3 Replies View Related

C# :: Change File Format

Jun 20, 2013

I have installed VS 2010 and VS 2012. VS 2012 uses SqlServer CE 3.5 and VS 2012 uses SqlServer CE 4.0.The problem is that when a project uses a 3.5 file it tries to open it with 4.0 even if the app.config says to use the 3.5 provider. The version of the assembly is pulled right out of the GAC. I uninstalled 4.0 and the reference auto updated its version to 3.5.1. However after installing 4.0 again it changes to 4.0. The error I am getting is that 4.0 cannot open a 3.5 file....they changed the file format from 3.5 to 4.0 and they are not compatible.

View 2 Replies View Related

C :: Printing Of A File In Different Format?

Sep 13, 2013

The requirement is to capture statistics of uuid occurrences for ALIVE/SEARCH/BYEBYE (it can be all 3, combinations of 2 each, or one alone) in a dynamically populated file in run time.

I am able to print all 3 combinations, but not in combination of 1 or 2 e.g.

If my input.txt is like this :

uuid:22314754-a597-490b-8a93-02cfae01036b ALIVE 16
uuid:22314754-a597-490b-8a93-02cfae01036b BYEBYE 8
uuid:22314754-a597-490b-8a93-02cfae01036b SEARCH 8
uuid:50e65653-7525-485d-83bf-d293558c4264 ALIVE 32
uuid:50e65653-7525-485d-83bf-d293558c4264 BYEBYE 8
uuid:50e65653-7525-485d-83bf-d293558c4264 SEARCH 132

[Code]...

Code:

#include<stdio.h>
#include<string.h>
struct uid
{
char uid_val[100];
char state[100];
int temp_count;
int alive_count;
int search_count;

[Code]...

Gives the following output ->output.txt)

Device ID ALIVE BYEBYE SEARCH
uuid:22314754-a597-490b-8a93-02cfae01036b 16 8 8
uuid:50e65653-7525-485d-83bf-d293558c4264 32 8 132
uuid:55076f6e-6b79-4d65-6497-180373763bc1 113 112 111
uuid:T0100203354 1 2 3

I want to generalize the code such that uuid occurrence does not have to be all 3 (ALIVE/SEARCH/BYEBYE), the occurrences can be any combination and code should work. e.g my code gives wrong results when input.txt contains the following:

uuid:22314754-a597-490b-8a93-02cfae01036b BYEBYE 8
uuid:22314754-a597-490b-8a93-02cfae01036b SEARCH 8
uuid:50e65653-7525-485d-83bf-d293558c4264 ALIVE 32
uuid:50e65653-7525-485d-83bf-d293558c4264 BYEBYE 8
uuid:55076f6e-6b79-4d65-6497-180373763bc1 ALIVE 113
uuid:55076f6e-6b79-4d65-6497-180373763bc1 BYEBYE 112
uuid:55076f6e-6b79-4d65-6497-180373763bc1 SEARCH 111
uuid:T0100203354 BYEBYE 2

I am using ubuntu for gcc/g+ compiler.

View 1 Replies View Related

C++ :: How To Convert Characters To Hex Format

Oct 4, 2014

Is my understanding correct?

Ascii 'a' = 61 (Hex)
Ascii '0' = 30 (Hex)

So this is how we convert characters to hex.

Integer 0 = 0 (Hex), because it's not a character but an integer.

View 8 Replies View Related

C/C++ :: How To Format A Calendar Table

Apr 27, 2014

I am trying to format a Gregorian Calendar that accepts only the year as a user input, but I want the display to show 3 months on one row. I can get January to display correctly, but the February and March months do not.

I think my loop inside of my calendar1 function specifically is the issue:

//Is day before Sat? Else start next line Sun.
if ( ( day + daycode ) % 7 > 0 )
cout << right << setw(3);

[Code]......

View 1 Replies View Related

C/C++ :: Format Output Into Columns?

Apr 8, 2015

My output right now is:

Enter first prime numbers that will be used or -1 to end: 20
Twin Prime Number : (3,5)
Twin Prime Number : (5,7)
Twin Prime Number : (11,13)
Twin Prime Number : (17,19)

But what I want is:

1. {3;5} 2.{5,7} 3.{11,13}

4. {17,19}

else if (i - prime_number == 2)
{
cout << "{" << prime_number << ";" << i << "}" << endl << endl;
prime_number = i;
}

View 1 Replies View Related

Visual C++ :: Keep CDialog In 16:9 Format?

Dec 19, 2013

I have a Dialog with a Browser Control and load a Site with a Video, as the Title says, is there any Way to keep a Dialog in the Format of 16:9 Format, in eg. if someone change the Width or Height of a Dialog, the Height/Width should be changed to? To keep this Format permanent?

My first try was in a OnSizing(UINT fwSide, LPRECT pRect) Function but this is not the best way, because any Time i want to resize my Dialog it flickers terribly and i know i make it in a wrong way.

View 3 Replies View Related







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