C/C++ >> How do you display pictures in c++
Posted by kpyro on 10:27:00 05-03-2002
How do show pictures in c++?? Help me... [addsig]
Posted by MoX on 14:52:00 05-03-2002
C++ itself does not offer any possibility. You'll have to use libraries. There are various choices. OpenGL, SDL, SVGAlib(Linux only). You'll also need the proper libs to load images.
[addsig]
Posted by KaGez on 19:37:00 05-03-2002
it would be _loads_ of work, but you could try to do some ASCII art.... not recommended tho... I'd also use a library... easiest would be GTK+...
[addsig]
Posted by kpyro on 23:04:00 05-03-2002
I've already done ASCII art. I want actual pictures to be displayed. Does anyone have links to a set of libraries? When I search google, it comes up with all Visual C++ crap. [addsig]
Posted by KaGez on 01:24:00 05-04-2002
http://www.libsdl.org (2d)
http://www.gtk.org (GUI Kit)
http://www.OpenGL.org (3d and 2d)
http://www.microsoft.com/directx/ (3d and 2d)
http://www.directfb.org (console 2d)
http://www.clanlib.org (2d)

I think you won't need more than this This covers all you could ever need
[addsig]
Posted by kpyro on 02:52:00 05-04-2002
All I simply want is a library with a function like c = ("bob.bmp"); view(c); or something like that......... [addsig]
Posted by MoX on 11:23:00 05-04-2002
Heh...this is C++...not BASIC [addsig]
Posted by KaGez on 22:13:00 05-04-2002
All the libraries above need to be initialized (you need to code some stuff for that, yes ), but after you've got the picture in memory most can just display the pic with some function calls... but I don't think that there is something that does it with only
pic = load("image.png");
display(pic);

But, you could create wrappers around those libs above that do such stuff it's quite easy to do so.
[addsig]
Posted by jkcnshs on 08:23:00 05-05-2002
So, in order to show pictures in C++, you have to put the code in C++ to show the pictures? I downloaded the OpenGL link that someone one the board gave me, and it didn't give me anything but a few examples, and a user guide. So is that what I was supposed to get?
Posted by KaGez on 11:57:00 05-05-2002
ok, for all libraries above, what you need for developing is:
1) the header file(s)
2) the libraries
3) a good learning source.
That's all you need. I think there was the OpenGL SDK on the MSDN. Just search for "OpenGL SDK" on the MSDN (if you use windows that is). If you're on linux, you will need to download a thing called "MesaGL". I think it was on http://mesa3d.sf.net .
[addsig]
Posted by kpyro on 03:10:00 05-07-2002
I have to do all that crap just to get it to show a bitmap, a 2D bitmap?! [addsig]
Posted by MoX on 03:29:00 05-07-2002
Welcome to the world of programming kpyro... [addsig]
Posted by kpyro on 07:36:00 05-07-2002
Yeah, thanx but I've been here for more than 2 years. [addsig]
Posted by MoX on 14:53:00 05-07-2002
Yeah...with BASIC maybe

Did not mean to offend you, but when you start coding with an efficient language things are a bit more difficult...

But if you consider yourself a programmer before doing so, well, you make yourself a joke [addsig]
Posted by KaGez on 22:29:00 05-07-2002
I don't know what you progged before, but I think there's no progging language that can display pictures or stuff without a API... ok, asm maybe
[addsig]
Posted by fsvara on 02:22:00 05-08-2002
QBASIC can at least display pictures with its standard libraries... given they are in that BLOAD/BSAVE format
Posted by KaGez on 18:22:00 05-08-2002
I was talking about _programming languages_!
j/k
but see, that one also uses a library
[addsig]
Posted by MoX on 02:45:00 05-09-2002
I was just remembering an older discussion wether html is a programming language.

Do you think it's the same type of people who call BASIC a _real_ programming lang?

Seriously, of course BASIC is a programming language, but it's meant for beginners... [addsig]
Posted by kpyro on 02:53:00 05-09-2002
I bet I could get together a bunch of people that program in Visual Basic together to argue whether it's a programming language or not. It's not just for beginners. What is so bad about VB?! Give me a list of what's wrong with it! [addsig]
Posted by fsvara on 07:43:00 05-09-2002
well, by my definition of "programming language" html _is_ a proramming language. In some way, even a TV is an interpreter for a programming language. It just depends on your point of view and definition...
Posted by jkcnshs on 10:10:00 05-09-2002
Oh God... not this again
Posted by KaGez on 21:46:00 05-09-2002
ok, let's not tlak about what is a programming language and what not... it really depends on how you understand the term "Programming Language".
What's wrong with VB? hmmm, you ask good questions. I'll tell you, but don't gt mad on this answer, this is only a personal opinion:
1) It runs on windows only (natively)
2) the last time I used it it was kind of slow (I dunno how it is now)
3) You need 1000s of book for using it properly. There is a function for everything (almost), so I don't htink it's too funny to program with it, or not so challenging (if you understand what I mean)
4) The programs that have a VB interface are mostly highly insecure (now don't say no, this one is true ) Look at for example Outlook. You don't wanna tell me that it is secure after all that happened lately...

So, this is what I think about VB. I didn't want to attack anybody, start a flamewar or anything, this is just what I think about VB, and nothing more. OK, maybe some parts of it are wrong, if so tell me. I think that at least the speed part _could_ be wrong by now, but I listed it because I experienced that last time I used VB for some office work.
[addsig]
Posted by dxprog on 22:44:00 05-09-2002
Not to start a war here but there are plenty of things wrong. There are a lot of things that are Windows only. VB does not need thousands of book to use it right. And there are other things that run slower. Take my younger brother's "programming" thing. It's a drag and drop game\app creator. Now THAT'S slow. Even on a PIII 450 it isn't too swift. And is anything really secure? That Windows XP firewall bug for example. Note to KaGez - I don't hate your guts. The opposite, you're great. I'm just trying to defend what I use. Oh yeah the same goes for ASP. [addsig]
Posted by Peter on 06:13:00 05-10-2002
My arguments:

For VB:
-Quite easy & fast to use

Against VB:
-Totally platform dependant
-Generates large program files
-Quite slow too, AFAIK, awful memory management (of course it's faster than Klik & Play and stuff, but if we're talking in terms of programming languages that can be used professionally)
-Because of its size and speed problems, it's not very powerful. I've never seen some 3d thing in VB that ran effortlessly, for instance.

this is, again, only my opinion .
Posted by dxprog on 07:47:00 05-10-2002
Once again I am NOT out to start a flame war. Just correcting Peter. You can make the exe, smaller, faster in the advanced compile settings in VB6.
Posted by Peter on 18:32:00 05-10-2002
Okay, never did that..
Posted by KaGez on 21:12:00 05-10-2002
dxprog:
I neither wanted to start a flamewar with you, I just wrote what I experienced when I programmed with VB (ok, that was only like 2 weeks, but enough for me ). And, another thing why VB is not too interesting is, because I'm more interested in Open Source game programming and web-devel. ok, VB would maybe work for the game stuff, but it won't work on any platform than on windows. And, since I'm using linux, I don't want to start up windows for learning a API or a proggin lang that I can't use later anyways. OK, I've learned OpenGL in windows before, because my book's code was written for it. But, I think that payed off, because I can also use OpenGL under linux
So, the above is the main reason why I dislike VB. I don't hate it, I just dislike it I think it's the same as javascript for me:
Before every browser had it's own standards and ways to interpret the js code, but now there is a standard from the w3c (I think it's from the w3c, not sure tho), so it gets interesting if you ask me. I'm wanting to learn JS now, yes
I think this would be the same for VB for me. If there was a "usable" linux interpreter/compiler for VB I think I'd also look into VB
[addsig]
Posted by dxprog on 23:09:00 05-10-2002
Borland's Delphi is like the Borland VB. My uncle programmed in it and said it wasn't too bad. They recently made a version for Linux. You might want to check that out. [addsig]
Posted by KaGez on 23:26:00 05-10-2002
hm, Delphi? that's the "advanced" version of Pascal, right?
[addsig]
Posted by dxprog on 02:26:00 05-11-2002
I have no idea. All I know is that they say it's a good replacment for VB users. I saw a banner that said "Want to program VB in Linux. Use Delphi" or something like that, so I am under the assumption that's what it is.
Posted by kpyro on 03:04:00 05-11-2002
Well...There is only one way to really know what you are talking about here. And that is to be on both sides. Although I love VB and wouldn't drop it for the world there a few flaws, including size. But, have you ever programmed in VB and really, I mean really, noticed a speed difference? And size, the biggest program I have ever made was about 1 meg for the exe. I do also program in C++ but that isn't even fun. VB is fun. So what if there are a lot of commands. You don't have to know all the commands to do a basic program. I have heard so many people dis on VB that is sickening. There are some pretty hardcore programs out there that have been made in VB. Also, about the Outlook being insecure, that is not necessarily it being insecure, it just shows what can be done through VB. If you didn't know, alot of virii are created using vb macros. For instance, the LOVEBUG virus. Have you ever looked at the code in the LOVEBUG? It's pretty damn interesting. And there are many others that were in vb. The reason vb is used for virii is because it's simple, and it can be made into a macro that can be ran from a webpage. So maybe it's not just little kids that are programming in VB. [addsig]
Posted by dxprog on 06:17:00 05-11-2002
WHHHHHHHHHHHHHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!! YYYYYYYYEEEEEAAAAAAAAAAAAAAHHHHHHHHH!!!!!!!! Way to go!!!!!!!!!!!!!! [addsig]
Posted by KaGez on 10:32:00 05-11-2002
hey, we didn't want to start a flamewar, just to remind you
I'd love to reply to kypro, but I won't, no.... it'll just start a flamewar. sorry It would be a cool discussion in IRC tho
[addsig]
Posted by Flikm on 11:02:00 05-11-2002
... VB lollipops.
1) speed, yes, speed
2) no standard functions?!?!
3) size, omg its huge
4) platform dependency
5) why do you need those strange dll things?
6) limited, try to hack the asm output of vb ...
7) builds bad habits
the seven reasons why i think vb lollipops. delphi is the visual version of pascal. it rids of the speed, portability, and dll problems of vb. ive seen some good stuff come out from it..
Posted by dxprog on 22:49:00 05-11-2002
Well if there were more programming languages like VB there would be standards. VB is VB. It's the only one of it's kind. [addsig]
Posted by kpyro on 02:45:00 05-15-2002
No further questions. [addsig]
Posted by Flikm on 04:15:00 05-15-2002
... notice that this is he C/C++ forum.
Posted by KaGez on 15:52:00 05-15-2002
yeap
what was the actual topic anyways?...
oh, how to display images or what was it? :/
[addsig]
Posted by kpyro on 02:05:00 05-16-2002
Yeah, it was about displaying pictures and no one has really answered me yet so I am just giving up. Lock the topic, or do something I don't really care.
Posted by Peter on 02:16:00 05-16-2002
I'm tired of locking topics, let's just let them self-die.
Posted by dxprog on 02:28:00 05-16-2002
Really. I go on the General section and there are four or five locked topics in the last week. That's bad. [addsig]
Posted by fsvara on 04:34:00 05-16-2002
phpbb needs a function "delete all posts beginning with this one", so that you can delete just parts of a thread that got off topic and flamewarish

Well, if you look, you'll see that KEN is responsible for all of those locked topics, where he was deliberately provoking and spamming. He sent me a PM today telling me that this was his trolling forum... the exact message is this:
--
I COULD behave normally, but this is the one fun forum where I get to troll around and watch people blow up at a "fake me"... I'll converse with you normally on cprogramming.com or flashdaddee.com any day
--

So, he basically says he's here just to troll... Do we really need that on our forum? I can only say, a little ban has never hurt YPN's messageboard..
Posted by dxprog on 04:44:00 05-16-2002
I noticed that too. [addsig]
Posted by kpyro on 04:45:00 05-16-2002
Yeah, you should ban him...can you do that? [addsig]
Posted by Flikm on 06:27:00 05-16-2002
c++ doesnt have things that let you show images so you use whats called an api. an api has functions and definitions and crap that you can use for different things that the language doesnt support(gfx in this case). if you are using borland, you could try bgi, post somewhere or google for bgi, but bgi is slow and not very good for demos or games. a few of these apis are sdl, opengl, clanlib.
Posted by MoX on 17:01:00 05-16-2002
Don't think that a ban would work. Couldn't he just rejoin with another user name?

Better to spam his EMail with gigs of porn or something like that to show him how much fun spamming is.

Or, if you consider it, it might be a better idea to leave him here. When I'm at work and it's boring there's nothing better than replying to -KEN-'s posts. [addsig]
Posted by Peter on 19:16:00 05-16-2002
Hehe, usually, making a fool out of yourself is "punishment" enough. However, as some people obviously like being considered trolls, it's not that simple. I don't know actually..
Posted by MoX on 20:01:00 05-16-2002
It's okay if everybody knows that -KEN-'s just trollin'. This way we can simply ignore him. [addsig]
Posted by KaGez on 21:45:00 05-16-2002
or delete all of his posts
[addsig]
Posted by MoX on 22:10:00 05-16-2002
But leaving his posts we make our decision to ignore him comprehendable. [addsig]
Posted by fsvara on 00:16:00 05-17-2002
yeah. just ignore the shit. it's the best thing to do, and simple with some self-discipline, too
Posted by MoX on 01:05:00 05-17-2002
Would be best to not even discuss it anymore. Just do it... [addsig]
Posted by kpyro on 02:52:00 05-17-2002
Yeah, so let's just stop. [addsig]