Discussion Board

Results 1 to 15 of 15
  1. #1
    Regular Contributor er_benji's Avatar
    Join Date
    Feb 2006
    Posts
    217
    Hi,

    Does anybody know how i can get a screenshot of the screen?

    The idea is to draw the view, get a screenshot of it and save it in a bitmap (cfbsbitmap).

    Thanks in advance.
    Benji.

  2. #2
    Super Contributor antonypr's Avatar
    Join Date
    May 2003
    Location
    Vancouver, Canada
    Posts
    985
    Benji, do you just need a software to do that or you need to do it programmatically?

    I have developed a freeware application to capture screenshot (http://www.antonypranata.com/screenshot/). If you draw to a view, this application should be able to capture your screen.

    If you want do it programmatically, check this out, CWsScreenDevice::CopyScreenToBitmap().

    Antony

  3. #3
    Regular Contributor er_benji's Avatar
    Join Date
    Feb 2006
    Posts
    217
    I need to do it programmatically, i have just seen CWsScreenDevice class ant it seems to be perfect for me.

    I'll try it.

    Thank you very much.

  4. #4
    Regular Contributor er_benji's Avatar
    Join Date
    Feb 2006
    Posts
    217
    When i try to capture the screen, i get a kern-exec 3.

    Do you know what's happening?

    Code:
    iBitmap = new (ELeave) CFbsBitmap();
    CWsScreenDevice* screenDev = new (ELeave) CWsScreenDevice;
    if(screenDev != NULL)
    screenDev->CopyScreenToBitmap(iBitmap);

  5. #5
    Regular Contributor er_benji's Avatar
    Join Date
    Feb 2006
    Posts
    217
    Now, i have tried to get the CWsScreenDevice object from GC but i get a WSERV 7 error.

    CWindowGc& gc = SystemGc();
    iBitmap = new (ELeave) CFbsBitmap();
    CWsScreenDevice* screenDev = static_cast<CWsScreenDevice*>(gc.Device());
    if(screenDev != NULL)
    screenDev->CopyScreenToBitmap(iBitmap);

  6. #6
    Super Contributor antonypr's Avatar
    Join Date
    May 2003
    Location
    Vancouver, Canada
    Posts
    985
    If you look into SDK Help, WSERV7 means:

    Invalid bitmap handle.

    A corrupt bitmap handle was encountered. This is a common panic uncovered when a bitmap handle refers to nothing, or to a server-side object that isn’t a bitmap.
    You need to create your bitmap before calling CopyScreenToBitmap(). For example, you can do it via CFbsBitmap::Create() function.

    Antony

  7. #7
    Regular Contributor muntain's Avatar
    Join Date
    Jul 2006
    Location
    Italy
    Posts
    99
    With "CopyScreenToBitmap(iBitmap)" in most of 3rd edition devices it's not posible to take a screen capture of a video: you can only take a snapshot of the background. Do You know if ther's other trick to take a snap of the video? I tried to read direct from video memory without luck. Perhaps with direct screen access or with Hardware bitmap but in the SDK the documentation it's incomplete.

  8. #8
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    I guess this restriction is intentional and it supports DRM protection.

  9. #9
    Regular Contributor muntain's Avatar
    Join Date
    Jul 2006
    Location
    Italy
    Posts
    99
    I think you are right. Probably the problem is DRM. So I think that the only way o do that is to write my own pugin for decode video. Anyway I think that is a stupid restriction!

  10. #10
    Regular Contributor Asheesh's Avatar
    Join Date
    Jun 2003
    Posts
    83
    I can get a screenshot, when my applicaiton is in foreground, but if I send the app to the background I cant get the key events in my app. I am using

    iKey = iEikonEnv->RootWin().CaptureKey(EStdKeyUpArrow,0,0); // in constructor

    and in HandleKeyEventL below code..

    if (aEvent.Key()->iScanCode == EStdKeyUpArrow )
    {
    TakeScreenShotL();
    }

    Any clues, whats missing/wrong?

  11. #11
    Regular Contributor muntain's Avatar
    Join Date
    Jul 2006
    Location
    Italy
    Posts
    99
    I use the CaptureKey too and I get it works.
    Somthing like this:

    first you register the key
    Code:
    EHandleKey = iEikonEnv->RootWin().CaptureKey(EKeyLeftArrow,0,0);
    after you can handle the key

    Code:
    TKeyResponse C***AppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    
    if (aType == EEventKey)
    	{
    		switch(aKeyEvent.iCode)
    		{
    	          case EKeyLeftArrow:
    	          {
                      }
                    }
            }
    A question about the snapshot: You can get the snapshot beacause you are working on S60 2nd edition, it's right?

  12. #12
    Regular Contributor Asheesh's Avatar
    Join Date
    Jun 2003
    Posts
    83
    I still cant capture key events within my app when it is in background. Any clues what could be wrong?

  13. #13
    Regular Contributor muntain's Avatar
    Join Date
    Jul 2006
    Location
    Italy
    Posts
    99
    If you are using a 3rd edition device you need the SwEvent capability to get the capture key event

  14. #14
    Registered User rajeshkw's Avatar
    Join Date
    Jul 2011
    Posts
    2
    i am trying capture the screen with same code with symbian 3rd ed. SDk.i getting error like...
    Undefined symbol: 'int CWsScreenDevice::CopyScreenToBitmap(class CFbsBitmap const *) const (?CopyScreenToBitmap@CWsScreenDevice@@QBEHPBVCFbsBitmap@@@Z)'

    i am newbie plz help.

  15. #15
    Nokia Developer Champion vineet.jain's Avatar
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,836
    consider including ws32.lib in the mmp file of the project

Similar Threads

  1. How to continuosly capture the display?
    By iccananea in forum Python
    Replies: 8
    Last Post: 2007-01-08, 09:11
  2. A nice psychedelic show app
    By cyke64 in forum Python
    Replies: 4
    Last Post: 2005-11-14, 16:41
  3. Taking screenshot of app,which is in background?
    By mayur_24 in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2005-06-23, 10:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved