I have a C++ application (.Exe) dealing with Images. It takes a picture IN as parameter and automatically saves a new one as output.
I Want to run MY C# application, it will run the .exe one with string parameters and instead of having to read the image on the HDD i would like the C++ application to return right away a string or something to the parent C# app to deal with it again before saving on hdd.
I have the C++ source code. So i can modify its output that is for now:
unsigned char *pixels = new unsigned char[width * height * 3];
unsigned char *p = pixels, *b = bitmap;
int col, row;
for (row = 0; row < height; row++)
for (col = 0; col < width; col++)
{
*p++ = *b;
*p++ = *b;
*p++ = *b++;
}
corona::Image *img = corona::CreateImage(width, height, IMAGE_FORMAT, pixels);
corona::SaveImage(filename, corona::FF_AUTODETECT, img);
delete img;
So, what would be the new code in that C++ app? And what would be the code in my C# main parent app to run and get that output back to deal with? thanks guys
EDIT: For the C# part (Running C++ .exe and grabbing back the Output), i think i found the solution here on StackOverflow : How to hide cmd window while running a batch file?
Still need the C++ part since i totally know nothing about C++ please.