Turning flash on programatically

// Expert user has replied.
A Andrew Wood 3 years 6 months ago
3 1 0

My customer is writing their own camera app using the MS Direct Show api. They would like to use Flash progamatically but have not been able to find a way to use the flash either with
or without using DirectShow.  They know the registry hack to switch between the standard Windows mobile camera (flash can be On, Off or Auto) and the Motorola Camera (Flash can be on or off). So what they want to achieve is possible, they just can't find a way to do it from

within their C# application. Any ideas? Thanks Andy

Please Register or Login to post a reply

1 Replies

P Pietro Francesco Maggi

Hi Andy, I don't know in C#, but in the C++ code that interfaces with DirectShow, you can use the IID_IAMCameraControl interface to query and set the Flash value:     IAMCameraControl *pBZ=NULL;     long flags;~     hr = m_pVideoCaptureFilter->QueryInterface(IID_IAMCameraControl, (void **)&pBZ);     if(FAILED(hr)) {         RETAILMSG(1, (L"oh no! too bad it can´t query the IAMCameraControl interface!"));     }     long minFlash, maxFlash, step, def;     hr=pBZ->GetRange(CameraControl_Flash, &minFlash, &maxFlash, &step, &def, &flags); // Get Range of the Capture device for the Flash.     //number=1;     hr=pBZ->Set(CameraControl_Flash, maxFlash, CameraControl_Flags_Manual); // Set Flash to maximum.     if(FAILED(hr)) {         RETAILMSG(1, (L"oh no! too bad it can´t set this Flash value!"));     } Regards Pietro

CONTACT
Can’t find what you’re looking for?