Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Getting webcam input to BITMAP*.

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Getting webcam input to BITMAP*.
Wind Scar
Member #9,680
April 2008

Can you provide me a function to get the current USB webcam image into a allegro's BITMAP pointer? If it's too complicated a url so I can make it by myself does it.

Dizzy Egg
Member #10,824
March 2009
avatar

Wind Scar said:

If it's too complicated a url so I can make it by myself does it.

Not even Yoda could have understood that one.

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Matthew Leverton
Supreme Loser
January 1999
avatar

Wind Scar
Member #9,680
April 2008

(laughs) "If (you can't give me the function ready to use because of programming ethics etc), (providing me) a (link) so I can make (the function) by myself (is enough)."

OS Windows XP.

X-G
Member #856
December 2000
avatar

http://www.google.com/ is a good URL. Try that one.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Neil Walker
Member #210
April 2000
avatar

If the webcam saves an image every few seconds to a file then just use the appropriate allegro load function.

If it does something else then you'll need to know the interface/format for your webcam.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Wind Scar
Member #9,680
April 2008

Neil Walker, but MSN, for instance, can access the webcam regardless of it's type, so I suppose there's some default way to access it and consequently a function to convert it to an allegros bitmap pointer.

X-G for instance is probably too smart to answer and he wants me to search because he thinks I'm lazy and haven't done it enough. Maybe he's really so smart that he can get the answer in google in few seconds and he thinks everyone is so smart as him. Or maybe he is just bad and will fell exited with the idea someone's spending hour in search of an something. Anyway he'll not tell me the answer so his post was just as useless for this thread.

StevenVI
Member #562
July 2000
avatar

I don't remember the API calls anymore, but I read through the code for Dorgem to learn how to get the data. It'll give you a Windows bitmap, I believe, which you'll need to convert somehow. The specifics escape me now, as it was years ago when I did this...

__________________________________________________
Skoobalon Software
[ Lander! v2.5 ] [ Zonic the Hog v1.1 ] [ Raid 2 v1.0 ]

Wind Scar
Member #9,680
April 2008

That's a good start, thank you.
EDIT: Oh god enormous source :\

X-G
Member #856
December 2000
avatar

I posted google.com because you obviously are too lazy to just google for it. There are millions of webcam APIs out there. We're not here to perform menial tasks for you; if you can't even punch in a simple google search like "webcam api", don't expect to ever be able to make anything serious. Honestly... I say this because I care. It may not seem like it. But you'll be a million times better off in the long run if you learn how to fish instead of asking random strangers for fish all the time.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Trent Gamblin
Member #261
April 2000
avatar

There's even a program that does this in the depot, I think Johan Halmen made it, but I don't know if source is available.

Wind Scar
Member #9,680
April 2008

If I won't be able to do anything serious, so what? I asked for you to teach me programming? Did I say I am a programmer? Did I say I WANT to be a programmer and do something serious someday? What if i just want THIS app? Also did I ask for a webcam api? I asked for a function specific to allegro and I [b]HAVE SEARCHED[/b] and I did not find, and I'm sure [b]you[/b] are NOT capable of finding it randomly in google without lots of works and maybe having to write some code and do conversions because it's NOT something easy to find and actually maybe it's not even done yet. But, of course, in the mind of someone like you, it's better to have the fuckin work than to ask to someone that ocasionally have done it already.

Do you even know that when you google for something like that, 90% of what you get is actually topics like this asking something and answers of fags like yours asking to google it? Do you know THIS page someday will appaer on google and many people not so 'lazy' as I am will be without answer because of you? So, congratulations.

Do you want to know why I want this fuckin app? It's to aid someone that lost his arms movements making a program so he can control the computer someway. There are some programs out there but he's not doing well with them.
But unhappily I'm too lazy and I have to work every night and study every day so I have no time to search and search for something so abstract and difficult as that and I though 'if someone had already had this problem it would save me LOTS of time'. I actually could have it finished today if I had the function. But no, okay. Fuck it and thank you very much.

Dario ff
Member #10,065
August 2008
avatar

You sure this thread doesn't help? There's also a link to the utility FunKamtools, it comes with the source as well.

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

X-G
Member #856
December 2000
avatar

Okay, someone has more than a few anger issues, I see. Dude, chill. You're on a programming forum. On a site dedicated to a programming library. Populated entirely by programmers. In the subforum called "Programming Questions". Asking a question about programming. I think everyone assumes you're a programmer under those conditions.

I hope you'll find something you can use, I really do. Even more importantly, something which you can learn something from. But responding to honest attempts at help with personal insults and sexual slurs is not nice, and it's not productive. So calm down, and be polite instead of biting the hand that feeds.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Wind Scar
Member #9,680
April 2008

I'll be polite if you are nice. I was already expecting answers like yours and you must agree with me that you didn't add anything at all to the topic. Don't you agree?

Dario ff those does help and are what I had before I made the topic. If nobody comes with a better answer I'll be working on that. Thanks.

X-G
Member #856
December 2000
avatar

No, I don't agree at all. I think my answer is the only "teach a man to fish" answer among a sea of "here's your fish" answers, which are, ultimately, harmful to you. For that matter, I am nice. Don't confuse a firm grandmotherly hand with being rude.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Wind Scar
Member #9,680
April 2008

Why'd you teach a man to fish if he's not a fisherman and needs the fish just once in his life? Your concepts of right and wrong are totally screwed.

StevenVI
Member #562
July 2000
avatar

Weren't you on a fishing expedition for information? Surely at some point in the future you will want to find more information, such as how to program when you get to that stage of your project.... :)

It always helps to know what to search for. When I was looking for an example of capturing webcam data, I Googled for "open source webcam software".

__________________________________________________
Skoobalon Software
[ Lander! v2.5 ] [ Zonic the Hog v1.1 ] [ Raid 2 v1.0 ]

blargmob
Member #8,356
February 2007
avatar

Wind Scar said:

Why'd you teach a man to fish if he's not a fisherman and needs the fish just once in his life? Your concepts of right and wrong are totally screwed.

No, you're just a damned fool who is clearly incapable of abstract/critical thinking.

As mentioned before, you are biting the hand that feeds.

---
"No amount of prayer would have produced the computers you use to spread your nonsense." Arthur Kalliokoski

X-G
Member #856
December 2000
avatar

What those two said. You may not realize it, but you are a fisherman, and if you want to accomplish what you're setting out to do, you will need to know how to fish. What would you have done if someone had pointed you to a library, but you didn't understand the documentation? Asked for help again? What if it doesn't compile the first time; ask for help again? And again and again and again, every time some new issue pops up that a five-minute Google search could have answered for you...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Dario ff
Member #10,065
August 2008
avatar

EDIT: NVM, said something stupid.

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

GullRaDriel
Member #3,861
September 2003
avatar

I'm with X-G.

I think the hot weather is making some of us nervous.

A cup of tea, maybe ? :-/

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Wind Scar
Member #9,680
April 2008

So I'll bite again and again, because that's not the kind of help I give when I'm asked, so I'm not obliged to like to receive it.
If someone wants to help me I'd be very happy to receive the answer. If everyone thinks I'm a fag and doesn't reserve it, that's ok, I understand.

blargmob
Member #8,356
February 2007
avatar

Wind Scar said:

If everyone thinks I'm a fag

No one ever said this. Now you're just attacking yourself out of self-pity and paranoia; which I guarantee you, isn't the path to your answers.
::)

---
"No amount of prayer would have produced the computers you use to spread your nonsense." Arthur Kalliokoski

Dario ff
Member #10,065
August 2008
avatar

I don't think you're a fag. :P But I don't get it, what's the problem? Doesn't FunKamTools work well for you? It's open source, and it's done in Allegro, that's clearly the best option I could find. Or it doesn't work for your hardware? Does it really need to be made with Allegro?

I can't really help much since I don't have a webcam. Regarding "fishing once", who knows, you might find it more fun to search and develop it yourself, but if you're in a hurry, isn't some pre-made software a better choice?

I've found that sometimes, asking for what you're trying to achieve rather than something specific can yield much better results.

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

 1   2 


Go to: