Results 1 to 3 of 3

Thread: digital camera - TWAIN?

  1. #1

    Thread Starter
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545

    digital camera - TWAIN?

    Hi,

    I'm using the capCreateCaptureWindowA API to display video from a digital camera (works fine). A customer sent me an email asking me "does your program uses twain drivers, VFW or WMD to load images from the camera?".

    I am 'thinking' the answer is TWAIN, but I have no clue what VFW or WMD is. Is there anyone out there that can answer this question for me??

    Thanks in advance!

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Possibly:

    Video For Windows (VFW)
    Windows Driver Model (WDM)

    Industry standard software interface such as Multimedia Control Interface (MCI), Video for Window (VFW), and Windows Driver Model (WDM).


    Edit: Is it WMD or WDM?




    More:
    Microsoft Windows VFW Video Capture
    Microsoft Windows WDM Video Capture




    Bruce.
    Last edited by Bruce Fox; Feb 23rd, 2004 at 06:48 PM.

  3. #3

    Thread Starter
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    Do you know which one that API uses though? That is the important question. I found it on planet-source-code a long time ago. I really don't understand any of this stuff...

    here is the 'connect' function, which might help answer the question for someone who knows what they are talking about.

    VB Code:
    1. Private Function Connect() As Boolean
    2.     Dim lpszName As String * 100
    3.     Dim lpszVer As String * 100
    4.     Dim Caps As CAPDRIVERCAPS
    5.        
    6.     '//Create Capture Window
    7.     capGetDriverDescriptionA 0, lpszName, 100, lpszVer, 100  '// Retrieves driver info
    8.     lwndC = capCreateCaptureWindowA(lpszName, WS_CAPTION Or WS_THICKFRAME Or WS_VISIBLE Or WS_CHILD, _
    9.                                     ScaleX(2000, vbTwips, vbPixels), _
    10.                                     ScaleX(100, vbTwips, vbPixels), _
    11.                                     100, _
    12.                                     120, _
    13.                                     Me.hWnd, 0)
    14.  
    15.     '// Set title of window to name of driver
    16.     SetWindowText lwndC, lpszName
    17.    
    18.     '// Set the video stream callback function
    19.     capSetCallbackOnStatus lwndC, AddressOf MyStatusCallback
    20.     capSetCallbackOnError lwndC, AddressOf MyErrorCallback
    21.    
    22.     '// Connect the capture window to the driver
    23.     If capDriverConnect(lwndC, 0) Then
    24.         '/////
    25.         '// Only do the following if the connect was successful.
    26.         '// if it fails, the error will be reported in the call
    27.         '// back function.
    28.         '/////
    29.         '// Get the capabilities of the capture driver
    30.         capDriverGetCaps lwndC, VarPtr(Caps), Len(Caps)
    31.        
    32.         '// If the capture driver does not support a dialog, grey it out
    33.         '// in the menu bar.
    34. '        If Caps.fHasDlgVideoSource = 0 Then mnuSource.Enabled = False
    35. '        If Caps.fHasDlgVideoFormat = 0 Then mnuFormat.Enabled = False
    36. '        If Caps.fHasDlgVideoDisplay = 0 Then mnuDisplay.Enabled = False
    37.        
    38.         '// Turn Scale on
    39.         capPreviewScale lwndC, True
    40.            
    41.         '// Set the preview rate in milliseconds
    42.         capPreviewRate lwndC, 66
    43.        
    44.         '// Start previewing the image from the camera
    45.         capPreview lwndC, True
    46.            
    47.         '// Resize the capture window to show the whole image
    48.         ResizeCaptureWindow lwndC
    49.        
    50.         Connect = True
    51.     Else
    52.         Connect = False
    53.     End If
    54.  
    55. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width