1. Very Simple Webcam tool

I've just sent to the archives a library and example of the basic use of
avicap32.dll.

It's code that anyone can use (not very big and reasonable documentation) and
enhance to do whatever they need it to do.

Thanks goes to Alexander Toresson for his recent posts on the same subject -
they gave me a reason to go back and review the previous mess I'd made of the
same thing!!!  Fixed it, understood where I'd gone wrong and decided the result
was something I'd like to give to you all :)

The library is nowhere near a complete wrapper around avicap32.dll, I really
don't have the time for that just yet, but it might give people a starting point
- I hope.

Enjoy it, and post any interesting enhancements back to the archive for all to
see.

Dave

. .. : :: = == == = :: : .. .
Server-Side DB driven web sites,
Software Development
and part-time games developer

contact dave_p at purpletiger dot com
. .. : :: = == == = :: : .. .

new topic     » topic index » view message » categorize

2. Re: Very Simple Webcam tool

Dave Probert wrote:
> 
> I've just sent to the archives a library and example of the basic use of
> avicap32.dll.
> 
> It's code that anyone can use (not very big and reasonable documentation) and
> enhance
> to do whatever they need it to do.
> 
> Thanks goes to Alexander Toresson for his recent posts on the same subject -
> they gave
> me a reason to go back and review the previous mess I'd made of the same
> thing!!!
> Fixed it, understood where I'd gone wrong and decided the result was something
> I'd
> like to give to you all :)
> 
> The library is nowhere near a complete wrapper around avicap32.dll, I really
> don't
> have the time for that just yet, but it might give people a starting point - I
> hope.
> 
> Enjoy it, and post any interesting enhancements back to the archive for all to
> see.
> 
> Dave
> 

This is kinda how far I've gotten too. What I need to do is grab the image and
then process it. I think using WM_CAP_SAVE_BMP and then loading the bmp would be
too slow... so I tried using WM_CAP_GRAB_FRAME_NOSTOP to get a callback with
data... but I have no idea how to interpret that data. It's an LPVIDEOHDR, which
has a member called lpData, which contains the image data, but in a format
unknown to me (and msdn is not a bit enlightening in that case). I'll try
processing it as normal image data, even though the C++ code suggests it ain't...

Regards, Alexander Toresson

new topic     » goto parent     » topic index » view message » categorize

3. Re: Very Simple Webcam tool

Alexander Toresson wrote:
> 
> Dave Probert wrote:
> > 
> > I've just sent to the archives a library and example of the basic use of
> > avicap32.dll.
> > 
> > It's code that anyone can use (not very big and reasonable documentation)
> > and enhance
> > to do whatever they need it to do.
> > 
> > Thanks goes to Alexander Toresson for his recent posts on the same subject -
> > they gave
> > me a reason to go back and review the previous mess I'd made of the same
> > thing!!!
> > Fixed it, understood where I'd gone wrong and decided the result was
> > something I'd
> > like to give to you all :)
> > 
> > The library is nowhere near a complete wrapper around avicap32.dll, I really
> > don't
> > have the time for that just yet, but it might give people a starting point -
> > I hope.
> > 
> > Enjoy it, and post any interesting enhancements back to the archive for all
> > to see.
> > 
> > Dave
> > 
> 
> This is kinda how far I've gotten too. What I need to do is grab the image and
> then
> process it. I think using WM_CAP_SAVE_BMP and then loading the bmp would be
> too slow...
> so I tried using WM_CAP_GRAB_FRAME_NOSTOP to get a callback with data... but I
> have
> no idea how to interpret that data. It's an LPVIDEOHDR, which has a member
> called lpData,
> which contains the image data, but in a format unknown to me (and msdn is not
> a bit
> enlightening in that case). I'll try processing it as normal image data, even
> though
> the C++ code suggests it ain't...
> 

Yes, the length of the image data is 230400 bytes, which is 320 * 240 * 3, so it
is (or should be) the raw image data!

Regards, Alexander Toresson

new topic     » goto parent     » topic index » view message » categorize

4. Re: Very Simple Webcam tool

Alexander Toresson wrote:
> Yes, the length of the image data is 230400 bytes, which is 320 * 240 * 3, so
> it is
> (or should be) the raw image data!

Actually, the data returned, is the same data you would receive, if you did a
raw Peek of a hDIB memory allocation.  You should look into freeimage.ew, and
more specifically, CreateHBitmap(), for the way to load the data into a Win32
HDIB Compatable image, to draw to a window.  FreeImage returns the data in the
same format, of #RRGGBB * Height * Width, or is that #RRGGBB * Width * Height.
Can't remember which, but in either case, that is the method in which the data
should be relayed to you.

Mario Steele
http://enchantedblade.trilake.net
Attaining World Dominiation, one byte at a time...

new topic     » goto parent     » topic index » view message » categorize

5. Re: Very Simple Webcam tool

Mario Steele wrote:
> 
> Alexander Toresson wrote:
> > Yes, the length of the image data is 230400 bytes, which is 320 * 240 * 3,
> > so it is
> > (or should be) the raw image data!
> 
> Actually, the data returned, is the same data you would receive, if you did a
> raw Peek of a hDIB memory allocation.  You should look into freeimage.ew, and
> more specifically, CreateHBitmap(), for the way to load the data into a Win32
> HDIB Compatable image, to draw to a window.  FreeImage returns the data in the
> same format, of #RRGGBB * Height * Width, or is that #RRGGBB * Width * Height.
> Can't remember which, but in either case, that is the method in which the data
> should be relayed to you.
> 

I've got a pointer to a dib now. I wanted to look at that code to see how it
"registers" the dib to get a win32lib handle or whatever, but the only thing with
freeimage I can find in the archive is freedib, which includes freeimage.ew, but
that doesn't contain CreateHBitmap() or fiCreateHBitmap().
However, it contains fiCreateFIBitmap() and fiCreateDIB(). I've got no clue what
either of them do, and there are no docs covering them.

Regards, Alexander Toresson

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu