Results 1 to 2 of 2

Thread: VCD properties, getRangeMin() problem

  1. #1
    Join Date
    Jul 2017
    Posts
    1

    VCD properties, getRangeMin() problem

    Hello!

    I'am using DMK33GP2000e camera, the following code:

    ----------------------------------------------------------------------------------------------------------------------------------------------
    bool SetBrightnessAbsolute(DShowLib::Grabber *pGrabber, double dBrigtness)
    {
    bool bOK = false;
    DShowLib::tIVCDAbsoluteValuePropertyPtr pBrigtnessRange;
    DShowLib::tIVCDSwitchPropertyPtr pBrigtnessAuto;

    pBrigtnessRange = NULL;
    pBrigtnessAuto = NULL;

    if (pGrabber->isDevValid())
    {
    DShowLib::tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
    if (pItems != 0)
    {
    // Try to find the exposure item.
    DShowLib::tIVCDPropertyItemPtr pBrigtnessItem = pItems->findItem(DShowLib::VCDID_Brightness);
    if (pBrigtnessItem != 0)
    {
    // Try to find the value and auto elements
    DShowLib::tIVCDPropertyElementPtr pBrigtnessValueElement = pBrigtnessItem->findElement(DShowLib::VCDElement_Value);
    DShowLib::tIVCDPropertyElementPtr pBrigtnessAutoElement = pBrigtnessItem->findElement(DShowLib::VCDElement_Auto);

    // If an auto element exists, try to acquire a switch interface
    if (pBrigtnessAutoElement != 0)
    {
    pBrigtnessAutoElement->getInterfacePtr(pBrigtnessAuto);
    pBrigtnessAuto->setSwitch(false); // Disable auto, otherwise we can not set exposure.
    }


    // If a value element exists, try to acquire a range interface
    if (pBrigtnessValueElement != 0)
    {
    pBrigtnessValueElement->getInterfacePtr(pBrigtnessRange);

    double min = pBrigtnessRange->getRangeMin();
    double max = pBrigtnessRange->getRangeMax();

    if (dBrigtness < min)
    {
    dBrigtness = min;
    }
    else if (dBrigtness > max)
    {
    dBrigtness = max;
    }

    // Here we set the the exposure value.
    pBrigtnessRange->setValue(dBrigtness);
    bOK = true;
    }
    }
    }
    }
    return bOK;
    }
    ----------------------------------------------------------------------------------------------------------------------------------------------

    And I have exception Thrown in IVCDPropertyInterfaces_inl.h

    inline double IVCDAbsoluteValueProperty::getRangeMin() const
    {
    double rval;
    ----> HRESULT hr = get_RangeMin( &rval ); x
    if( FAILED( hr ) ) throw hr;
    return rval;
    }



    What is the problem?

    I use similar code with Exposure, and it works properly.

    Thank you in advance
    Attached Images Attached Images

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

    Re: VCD properties, getRangeMin() problem

    Hello

    DShowLib::tIVCDAbsoluteValuePropertyPtr pBrigtnessRange; does not exist. But the normal range interface for long values exists.
    Best regards
    Stefan
    IC Imaging Control Support

Similar Threads

  1. Problem getting VCD Properties (VB)
    By kmmatney in forum IC Imaging Control .NET
    Replies: 3
    Last Post: May 29, 2017, 08:44:38
  2. Problem with properties dialog
    By bathongkr in forum IC Imaging Control C++ Class Library
    Replies: 3
    Last Post: March 18, 2010, 01:56:35
  3. Properties
    By Bolle in forum IC Imaging Control C++ Class Library
    Replies: 3
    Last Post: December 29, 2006, 15:48:16
  4. How to set and get DCAM properties
    By yita in forum IC Imaging Control C++ Class Library
    Replies: 1
    Last Post: August 9, 2004, 11:26:53
  5. properties-page
    By ryne in forum MontiVision Development Kit
    Replies: 4
    Last Post: July 29, 2004, 17:42:34

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
  •