Results 1 to 3 of 3

Thread: Auto focus

  1. #1
    Join Date
    Jul 2012
    Location
    Nevada USA
    Posts
    3

    Auto focus

    Hello,

    I'm using the DFK 72AUC02-F camera with the ActiveX control in a VBA application. There is a button on the dialog shown when the ShowPropertyDialog method is invoked that, when clicked, will cause the camera to auto focus. I would like to put a button like this directly on to my VBA form. However, I can't seem to find a method like this in the ActiveX documentation. I searched this forum but all I found was a suggestion to call a DirectShow method. I'm not sure what that means. Can you provide me with VB sample code to invoke the camera's auto focus? Thank you!

    Regards,

    Ron Hinds
    Da Bomb

  2. #2
    Join Date
    Jan 2003
    Location
    Bremen, Germany
    Posts
    4,862

    Re: Auto focus

    Hi Ron

    Using the autofocus can be done simply by using the VCDProperties. First of all, add the VCDPropertyID.BAS module to your VB project.
    Then insert the button event handler:
    PHP Code:
    Private Sub btnFocus_Click()
        
    Dim Focus As VCDButtonProperty
        
        Set Focus 
    ICImagingControl1.VCDPropertyItems.FindInterface(VCDID_Focus ":" _
                                                                    VCDElement_OnePush 
    ":" _
                                                                    VCDInterface_Button
    )
                                                                    
        If 
    Not Focus Is Nothing Then
            Focus
    .Push
        
    Else
            
    MsgBox "Autofocus not available. Correct camera installed and IC Imaging Control 3.1 or higher installed?"
        
    End If
    End Sub 

    Using VCDProperties in VB6 is shown here:
    http://www.imagingcontrol.com/en_US/...Properties.htm
    This little samples shows how to use VCDProperties and add the VCDPropertyID.BAS Module
    http://www.imagingcontrol.com/en_US/...geSettings.htm

    Using the VCDPropertyInspector, which is installed with IC Imaging Control, you can see the VCDID, VCDElement and VCDInterface needed for a property.

    In case VBA does not allow the use of modules, you can use the strings definded in the VCDPropertyID.BAS module directly.

    However, VB6 is outdated. You should switch to .NET. I guess, there is something similar to VBA.
    Best regards
    Stefan
    IC Imaging Control Support

  3. #3
    Join Date
    Jul 2012
    Location
    Nevada USA
    Posts
    3

    Re: Auto focus

    Thanks Stefan! Modules can be added to VBA projects, so that shouldn't be a problem. Or I should say I can cut and paste the code into a VBA module.

    VBA is used for automating Microsoft Office applications; in this case, the Access database application. There is no equivalent to .NET as a replacement for VBA, at least not in Office 2010 - I haven't tried the latest version of Office yet.
    Da Bomb

Similar Threads

  1. Auto-Focus Camera Lens Requirement
    By niranjan in forum Hardware and Driver
    Replies: 1
    Last Post: May 30, 2012, 17:34:19
  2. Auto white balance, auto exposure processing?
    By odissey1 in forum IC Imaging Control ActiveX
    Replies: 3
    Last Post: November 17, 2006, 16:21:19
  3. Crash when Ic lost the focus
    By willyx in forum IC Imaging Control .NET
    Replies: 5
    Last Post: August 8, 2006, 09:51:44
  4. auto gain and auto exposure with vb6
    By Jay Hanson in forum IC Imaging Control ActiveX
    Replies: 4
    Last Post: January 11, 2006, 09:11:10

Tags for this Thread

Bookmarks

Posting Permissions

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