We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,183 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Apache cgi-bin how to generate images with cpp?

Hi I would like to make cgi-bin program which will make dynamic pictures.
I know how to make cgi program which would output simple html file

#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
    cout <<"Content-type: text/html\r\n\r\n" << endl;
    try
    {
            cout<<"<html><body><h1>Test</h1></body></html>"<<endl;
    }
    catch (exception e)
    {
        cout<<" Nemorem prikazati slike."<<endl;
    }
    return 0;
}

So how should I change this program that insted of html page I would output a jpeg image?
First I have to change frst output to: "Content-type: Image/jpeg\r\n\r\n"
After that ...

2
Contributors
2
Replies
12 Hours
Discussion Span
10 Months Ago
Last Updated
3
Views
neronero
Newbie Poster
5 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

You have to learn how to write the file in jpeg format, as in this link and this wiki article

Ancient Dragon
Achieved Level 70
Team Colleague
32,139 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69

Is there any libary which can do that?
Or cgi program?
I don't want invent hot wather again.

neronero
Newbie Poster
5 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0630 seconds using 2.77MB