Jump to content

WebCam example


rysiora
 Share

Recommended Posts

$cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 160, "int", 120, "hwnd", $Main, "int", 1)

I tried this. But this only changes the size of the PREVIEW image.

The saved BMP is still 320x240.

Please advice further.

Thank you.

Vai

Link to comment
Share on other sites

I'm not sure.

From reading:

Func SnapShot()
    DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0)
    DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $snapfile)
EndFunc

I guess the sizes are taken from $cap.

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...

Hi,

I'm new, so be gentle. I have been coming to this forum and using AutoIt for some time now and must say that I am quite impressed with both.

Now, with the back-slapping out of the way, I'd like to ask a question. The WebCam script posted here is really quite good and has opened some avenues for me. However, I am not a C++ programmer and am a bit lost in the whole workings of it. I am using a TV card instead of a cam with this script and I'd like to take the script and be able to change the actual resolution of the output, (to say 640 x 480 or 1024 x 768). Not change the scale, (which one could do on this line:

$cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) )

but the actual resolution.

Also, I'd like to be able to get/set the channel and get/set capture device info. Any help anyone could give me would be greatly appreciated. :P

I'd also like to point out that the recording side of this script didn't work with my TV card. I fixed this by changing the last line of the StopRecording() function from:

DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $moviefile)

to:

DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEASA, "int", 0, "str", $moviefile)

if this is at all helpful to anyone.

Thanks in advance. (Should this have been posted in the General Support part of this forum or under this thread)? Hope to hear from anyone soon.

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

Had an error, this is why this appears twice. Sorry.

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

Since this example was created well over a year ago, you might be out of luck as far as hearing from the original author goes. You could try looking at the documentation of those API calls and see what turns up, however.

Link to comment
Share on other sites

Since this example was created well over a year ago, you might be out of luck as far as hearing from the original author goes. You could try looking at the documentation of those API calls and see what turns up, however.

Yeah, I searched the web, found alot of info out there, and have saved it and tried working with it. But, all of it is written in either C++ or VB and I just can't seem to translate from either to AutoIt. I suppose I could try to learn C++ or VB/VB.NET, but the ease of AutoIt is why I chose it in the first place.

My biggest problem is getting DLLCalls to work. Some of the code is so complicated, (for my little brain), that I just can't seem to make it work in AutoIt.

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

  • 1 month later...
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I think you could just remove the GUI show command and change the variables to what you want. Are you seriously asking for help with something so simple? It sounds like you need to make a couple of simple AutoIt programs or run through some tutorials first. I'd suggest doing that first then coming back to this software. It sounds like you're not using this for educational purposes as well, despite what you say. If you were really trying to learn, you'd realize quite quickly you can't just "dismiss" a GUI.

Link to comment
Share on other sites

  • 2 weeks later...

hi all,

this really a cool script and a good idea to check who touch your pc.

1 question if i would like to have the file name different how do i do that? i know need to add &$num& to the file name. how do i loop it ?

Link to comment
Share on other sites

  • 2 weeks later...

hello to all,

anyone think that is possible to merge this cool code with Aimbot pixelsearch code

to guide mouse cursor only with one finger, or in alternative give order

to pc with gestures....

Imagine a gride that rapresent desktop, maybe sub-square can give command when

a color enter in it. I watch too tv i know, but idea is pretty, or not ?

Can pixelsearch can find more than 1 point?

i made several experiments with camera, webcam and infrared LED. Try, is funny!

m.

15 min later...

i try simple code to recognize my tv remote control led, no matter distance,

or inclination, or light conditions, autoit recognize it as FFFFFFF color.

Edited by myspacee
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...