×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jan 2010
    Location
    Voronezh, Russia
    Posts
    24

    Question How to make a torch with strobe using camera flash?

    Hello.

    I'm writing a small application for Symbian using Qt. And I have a couple of questions (yes, I've checked all related topics and still didn't find the solution):

    1. How to use phone camera LED as a torch (Symbian API+Qt or Qt Mobility)?

    2. How to use phone camera LED/flash for strobe effect (Symbian API+Qt or Qt Mobility)? Flash should blink when user tap on screen, for example.

    I'm not familiar with Symbian API but I'm good in Qt.

    I tried this example with no result on my Nokia E7: http://www.developer.nokia.com/Commu..._using_CCamera

    Any help is appreciated! Thank you!
    Last edited by deviouscode; 2011-10-03 at 15:11.

  2. #2
    Registered User
    Join Date
    May 2009
    Location
    Greece
    Posts
    191

    Re: How to make a torch with strobe using camera flash?

    Hi, in an application of mine i use the Qt Mobility Camera API.

    Most of the camera operations are taken from the project: https://projects.developer.nokia.com/qcamera/ which is pretty good to get a quick handle of it.

    Further more i added a simple function to toggle the flash which looks something like the following. It is completely written in Qt so i thing you will find what you want

    Code:
    void QCameraControllerWidget::toggleFlash()
    {
        if(!m_camera)
            return;
    
        QCameraExposure* cameraexpo = m_camera->exposure();
        if(!cameraexpo)
            return;
    
    
        if(!flashButton->isPressed())
            cameraexpo->setFlashMode(QCameraExposure::FlashOff);
        else
        {
            if(cameraexpo->isFlashModeSupported(QCameraExposure::FlashTorch))
            {
                cameraexpo->setFlashMode(QCameraExposure::FlashTorch);
                flashButton->disableBtn(false);
            }
            else if(cameraexpo->isFlashModeSupported(QCameraExposure::FlashOn))
            {
                cameraexpo->setFlashMode(QCameraExposure::FlashOn);
                flashButton->disableBtn(false);
            }
            else
                flashButton->disableBtn(true);
        }
    }

    This answers to your first question. Regarding your second question you can try playing with the different flash modes.

  3. #3
    Registered User
    Join Date
    Jan 2010
    Location
    Voronezh, Russia
    Posts
    24

    Re: How to make a torch with strobe using camera flash?

    Quote Originally Posted by favoritas37 View Post
    This answers to your first question. Regarding your second question you can try playing with the different flash modes.
    Thank you for your quick response! I tried to change the FlashMode in these cases:
    1. camera is not started - LED doesn't work
    2. camera is started with video capture mode, no viewfinder - LED doesn't work
    3. camera is started with video capture mode, with viewfinder - LED doesn't work
    4. points 2-3 with still image capture mode - LED doesn't work
    5. points 2-4 with with camera searchAndLock - LED doesn't work

    Maybe there are should be any other configurations?

    In general flash should work only while capturing I guess so we can't just setFlashMode to activate it. At least in my configuration this solution doesn't work

    favoritas37, is it work with your phone? Maybe I did something wrong.
    Last edited by deviouscode; 2011-10-03 at 17:15.

  4. #4
    Registered User
    Join Date
    May 2009
    Location
    Greece
    Posts
    191

    Re: How to make a torch with strobe using camera flash?

    Sorry deviouscode, this is my bad. Indeed i have the same problem...i thought it was solved already...i had totally forgot that.

    The bad thing is that although the code looks logical it doesn't work...

  5. #5
    Registered User
    Join Date
    Jan 2010
    Location
    Voronezh, Russia
    Posts
    24

    Re: How to make a torch with strobe using camera flash?

    Quote Originally Posted by favoritas37 View Post
    i thought it was solved already...i had totally forgot that.
    I guess it can't be solved in such a simple manner All suggested solutions on different web sites are the same - use setFlashMode. But it doesn't work! And all such threads finished with one reply - "it doesn't work"

    It will be great finally to make a wiki page with the solution. Because there are a lot of torches in the store. And they work!
    there.is.no.right.way

  6. #6
    Registered User
    Join Date
    May 2009
    Location
    Greece
    Posts
    191

    Re: How to make a torch with strobe using camera flash?

    https://bugreports.qt.nokia.com/browse/QTMOBILITY-1792 unfortunately.

    I will take a look at the following: http://www.developer.nokia.com/Commu..._using_CCamera
    in case it works using some Symbian C++.

  7. #7
    Registered User
    Join Date
    Jan 2010
    Location
    Voronezh, Russia
    Posts
    24

    Re: How to make a torch with strobe using camera flash?

    Quote Originally Posted by favoritas37 View Post
    I will take a look at the following: http://www.developer.nokia.com/Commu..._using_CCamera
    in case it works using some Symbian C++.
    As I mentioned in my first post I already tried this example with no result. But I can do something wrong so if it will work for you could you please write about your configuration.
    there.is.no.right.way

  8. #8
    Registered User
    Join Date
    Jan 2010
    Location
    Voronezh, Russia
    Posts
    24

    Re: How to make a torch with strobe using camera flash?

    Is There Anybody Out There? Could please anyone from Symbian Gurus help me to make a torch application? It can be code for pure Symbian. Or maybe link for complete sources. I checked these projects:
    http://www.developer.nokia.com/Commu..._using_CCamera
    http://www.developer.nokia.com/Commu...ing_CHWRMLight

    But their don't work on my Nokia E7. Am I doing something wrong?
    there.is.no.right.way

  9. #9
    Registered User
    Join Date
    Jan 2010
    Location
    Voronezh, Russia
    Posts
    24

    Re: How to make a torch with strobe using camera flash?

    Hello again Is there a solution for this thread?
    there.is.no.right.way

Similar Threads

  1. flash as a torch
    By dayangadesilva in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2011-04-16, 09:21
  2. Camera flash as torch?
    By ManuMies in forum Symbian
    Replies: 4
    Last Post: 2009-01-22, 08:17
  3. n73 flash as torch
    By jtullis in forum Symbian
    Replies: 1
    Last Post: 2008-12-15, 00:20
  4. Make the Flash on the N70 a torch??
    By 7210hobbbit in forum General Development Questions
    Replies: 10
    Last Post: 2008-11-07, 12:25
  5. 6681 camera flash light - TORCH APPL.
    By marecekc in forum Symbian
    Replies: 3
    Last Post: 2006-01-02, 18:45

Posting Permissions

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