473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Help needed on writing c++program takes a jpeg file name location& output it on HTML

31
I want to write a program that take a name of a person and also a name of a jpeg file with known destination and create an output on an HTML format but it should also display the picture help me out it is easy to take in name using CIN and Output file can be created usuing ofstream but the problem is how can i output a picture. can some body help me out
Nov 16 '06 #1
1 1587
macklin01
145 100+
I want to write a program that take a name of a person and also a name of a jpeg file with known destination and create an output on an HTML format but it should also display the picture help me out it is easy to take in name using CIN and Output file can be created usuing ofstream but the problem is how can i output a picture. can some body help me out
It's not entirely clear what you want, but perhaps this will help get you started.

Expand|Select|Wrap|Line Numbers
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <fstream>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. int main( int argc, char* argv[] )
  9. {
  10.  char JpegFileName [1025];
  11.  cout << "Input jpeg filename: ";
  12.  cin >> JpegFileName;
  13.  
  14.  ofstream html_file( "image.html", ofstream::out );
  15.  
  16.  html_file << "<html>" << endl
  17.  << "<head>" << endl  
  18.  << JpegFileName << endl 
  19.  << "</head>" << \endl 
  20.  << "<body>" << endl << "<p>" << endl
  21.  << "<img src=\">" << JpegFileName << "\">" << endl
  22.  << "</p>" << endl
  23.  << "</body>" << endl
  24.  << "</html>" << endl;
  25.  
  26.  html_file.close();
  27.  
  28.  return 0;
  29. }
  30.  
Now, that generated file is not entirely w3c-standards compliant, but it's easy enough to add what's required to the header of the file. (character encoding and, doctype, etc.)

-- Paul
Nov 17 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: slickn_sly | last post by:
For some reason, I'm getting an error. It doesn't seem to be reading my "input.txt" file. I'm trying to read the "input.txt" file which consits of random integers and use insertion sort to sort...
54
by: bnp | last post by:
Hi, I took a test on C. there was an objective question for program output type. following is the program: main() { char ch; int i =2;
3
by: 00_CuMPe3WaR3D12 | last post by:
How do I write a user control that takes HTML and then renders it? Is it possible? I want to do something like this.. <Name:Box id="mybox" runat="server"> <table> .... any html can inserted...
1
by: MaTianyi | last post by:
the encoding of file that is output by the file.write() function is always None. and the encoding attribute of the File Object is readonly. f = open('abc.txt','w') print f.encoding how can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.