adding images

please help me add images to my c++ program..(turbo c++ 3.0)

Page 1 of 1

8 Replies - 81705 Views - Last Post: 24 September 2009 - 02:27 AM Rate Topic: -----

#1 arabethia   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-September 09

adding images

Post icon  Posted 17 September 2009 - 02:32 AM


How can I add images to my program in c++?? I have to make a program where in, I'll type a name and the picture of that person will appear. Please help me. I have to finish this project and I'm still a newbie to this programming thing. Any kind of help will do. Thanks a lot!!

Is This A Good Question/Topic? 0
  • +

Replies To: adding images

#2 galorin   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 86
  • Joined: 17-February 09

Re: adding images

Posted 17 September 2009 - 02:49 AM

View Postarabethia, on 17 Sep, 2009 - 01:32 AM, said:


How can I add images to my program in c++?? I have to make a program where in, I'll type a name and the picture of that person will appear. Please help me. I have to finish this project and I'm still a newbie to this programming thing. Any kind of help will do. Thanks a lot!!


What API are you using? What is your data source? and most importantly..
show us the code
If you have code already, we need to see it.
Was This Post Helpful? 0
  • +
  • -

#3 arabethia   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-September 09

Re: adding images

Posted 17 September 2009 - 03:29 AM

View Postgalorin, on 17 Sep, 2009 - 01:49 AM, said:

View Postarabethia, on 17 Sep, 2009 - 01:32 AM, said:


How can I add images to my program in c++?? I have to make a program where in, I'll type a name and the picture of that person will appear. Please help me. I have to finish this project and I'm still a newbie to this programming thing. Any kind of help will do. Thanks a lot!!


What API are you using? What is your data source? and most importantly..
show us the code
If you have code already, we need to see it.



The truth is i don't have a code just yet. I'm using turbo c++ ide 3.0. I just need to know the proper headers and commands so that i can display a jpeg in my program. Sorry for the lack of information. It's my first time to join a forum.

This post has been edited by arabethia: 17 September 2009 - 03:30 AM

Was This Post Helpful? 0
  • +
  • -

#4 galorin   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 86
  • Joined: 17-February 09

Re: adding images

Posted 17 September 2009 - 04:38 AM

View Postarabethia, on 17 Sep, 2009 - 02:29 AM, said:


The truth is i don't have a code just yet. I'm using turbo c++ ide 3.0. I just need to know the proper headers and commands so that i can display a jpeg in my program. Sorry for the lack of information. It's my first time to join a forum.


ok, you don't need the bold tags for an entire post.

Where will the jpegs be coming from? Are you wanting a console application (command line) or do you want a GUI (graphical user interface)? It sounds more like instead of not having code, you don't even have a jumping off point. Surely by now you will have at least some code to take an input name and change it in to a filename.

Do you want a Windows only program, or do yoy want to go cross-platform? There seem to be a lot of questions and not very many answers here.

This post has been edited by galorin: 17 September 2009 - 04:39 AM

Was This Post Helpful? 0
  • +
  • -

#5 arabethia   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-September 09

Re: adding images

Posted 23 September 2009 - 06:48 AM

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<fcntl.h>
void main()
{
z:
clrscr();
char a[20];
cout<<"Classmate Inventory";
/*This program is supposed to show
the picture of my classmate when i
choose their name from the choices*/
cout<<"\n\nclassmate a, classmate b, classmate c, classmate d, classmate e";
cout<<"\nnote: these are the only names accepted.please choose from these names";
cout<<"\n\nChoose the letter of the name of the person you want to view";
cin>>a;
if(a[20]=='a')
{goto aa;}
if(a[20]=='b')
{goto bb;}
if(a[20]=='c')
{goto cc;}
if(a[20]=='d')
{goto dd;}
if(a[20]=='e')
{goto ee;}
/*This is where i need help, i want
to show dsthe picture of classmate a
but i don't know how to do it. i dont
know how to add pictures to my c++
program.. by the way. its
turbo c++ ide 3.0 its dos based*/
switch(a[20])
{
aa:
case 'a':
/*show the picture of classmate a*/
break;
bb:
case 'b':
/*show the picture of classmate b*/
break;
cc:
case 'c':
/*show the picture of classmate c*/
break;
dd:
case 'd':
/*show the picture of classmate d*/
break;
ee:
case 'e':
/*show the picture of classmate e*/
break;
goto z;
}
getch();
}


well theres my code..please help me with this one..
i really am just new to these kind of things
thanks!!

*** MOD EDIT: Added code tags. Please :code: ***

This post has been edited by JackOfAllTrades: 23 September 2009 - 06:56 AM

Was This Post Helpful? 0
  • +
  • -

#6 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: adding images

Posted 23 September 2009 - 07:08 AM

Well... you need graphics... Now you could just add #include <graphics.h> to your program and use BGI (Borland Graphic Interface?) to display the images... but that is a lot of coding. I would probably spend some time at programmer's Haven looking at some of the older graphics libraries that include bitmap support.

I think I may have some old turbo C++ bitmap stuff -- though I don't know if I have anything to DISPLAY a bitmap as I was more interested in saving them then loading them (I loaded them into QBasic). If I find anything I will let you know...

in the mean time... why are you using turbo C++ 3.0? It really is an old compiler. My computer will not even run program written for it... no more 16bit apps. There are a number of modern compilers available for free (even updated versions of Borland's compiler) -- so if you are developing for a modern computer you should probably get a modern compiler.
Was This Post Helpful? 1
  • +
  • -

#7 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: adding images

Posted 23 September 2009 - 07:43 AM

well... I was right, I have a bunch of programs for writing bitmaps -- editing them in memory, but I can't find anything for displaying them. I DO have a program where I load a raw image (just raw pixel data) to the screen (ah the days of fixed graphics modes) but it used a VSA library that I *think* you can get from Programmer's Haven -- and it will not compile on a modern compiler (should compile on Turbo C++ 3.1... not sure about 3.0). The biggest problem with that is I wrote it when I was a kid and the source code is a mess...

try a google search for Turbo C++ BGI bitmaps -- you will find some promising stuff: like this
Was This Post Helpful? 0
  • +
  • -

#8 arabethia   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-September 09

Re: adding images

Posted 24 September 2009 - 02:17 AM

well..the reason why i am using this old compiler is because its the one that we have to use at school..personally i won't even download this compiler if it weren't that important at school..

..anyways thanks for the information..i appreciate it a lot!!
Was This Post Helpful? 0
  • +
  • -

#9 arabethia   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-September 09

Re: adding images

Posted 24 September 2009 - 02:27 AM

..one more thing i forgot to ask.what functions will i use and how to use them??and i would also like to know if i can get an image from my computer to the program itself by just typing in the location of the image??
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1