lundi 19 mai 2014

c# - si quelqu'un pourrait expliquer comment changer la résolution de mon webcam basée sur ce tutoriel - Stack Overflow


Following other stackoverflow threads I've been using this url here to make a Windows form program that uses my webcamera. However the author is long gone which brings me here.


I'm using this basically in the exact same way as he do, streams the webcam and onclick it saves a screenshot. Everything works great, but now I want to increase the resolution and maybe the quality(if it is possible?) of the webcamera stream/screenshot.


However I'm using a Logitech webcamera and supposedly you cannot change the default settings of it and you have to change the resolution specifically for that program(and within that program). So I have to change my code to make it display the webcamera as 1280x720 rather than the default 640x480.


But I have no idea how to do this within the code


Following his tutorial. I presume the variables I should change are these


private const short WM_CAP = 0x400;
private const int WM_CAP_DRIVER_CONNECT = 0x40a;
private const int WM_CAP_DRIVER_DISCONNECT = 0x40b;
private const int WM_CAP_EDIT_COPY = 0x41e;
private const int WM_CAP_SET_PREVIEW = 0x432;
private const int WM_CAP_SET_OVERLAY = 0x433;
private const int WM_CAP_SET_PREVIEWRATE = 0x434;
private const int WM_CAP_SET_SCALE = 0x435;
private const int WS_CHILD = 0x40000000;
private const int WS_VISIBLE = 0x10000000;
private const short SWP_NOMOVE = 0x2;
private short SWP_NOZORDER = 0x4;
private short HWND_BOTTOM = 1;

But what should I change these to, if these even are the correct ones? I'm using the same code as he, so you can look at his tutorial for more details.


The webcamera in question is a Logitech Pro 9000 but it might vary.


Thanks in before hand!



Following other stackoverflow threads I've been using this url here to make a Windows form program that uses my webcamera. However the author is long gone which brings me here.


I'm using this basically in the exact same way as he do, streams the webcam and onclick it saves a screenshot. Everything works great, but now I want to increase the resolution and maybe the quality(if it is possible?) of the webcamera stream/screenshot.


However I'm using a Logitech webcamera and supposedly you cannot change the default settings of it and you have to change the resolution specifically for that program(and within that program). So I have to change my code to make it display the webcamera as 1280x720 rather than the default 640x480.


But I have no idea how to do this within the code


Following his tutorial. I presume the variables I should change are these


private const short WM_CAP = 0x400;
private const int WM_CAP_DRIVER_CONNECT = 0x40a;
private const int WM_CAP_DRIVER_DISCONNECT = 0x40b;
private const int WM_CAP_EDIT_COPY = 0x41e;
private const int WM_CAP_SET_PREVIEW = 0x432;
private const int WM_CAP_SET_OVERLAY = 0x433;
private const int WM_CAP_SET_PREVIEWRATE = 0x434;
private const int WM_CAP_SET_SCALE = 0x435;
private const int WS_CHILD = 0x40000000;
private const int WS_VISIBLE = 0x10000000;
private const short SWP_NOMOVE = 0x2;
private short SWP_NOZORDER = 0x4;
private short HWND_BOTTOM = 1;

But what should I change these to, if these even are the correct ones? I'm using the same code as he, so you can look at his tutorial for more details.


The webcamera in question is a Logitech Pro 9000 but it might vary.


Thanks in before hand!


0 commentaires:

Enregistrer un commentaire