CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 2
  • Learn How to Create Dual Mode Windows Services

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old September 9th, 2009, 06:26 AM
    akgalp akgalp is offline
    Member
     
    Join Date: Dec 2003
    Location: Gods own country, India
    Posts: 243
    akgalp is on a distinguished road (40+)
    Exclamation Capture desktop screenshot( as bmp) with Windows Media Encoder APIs

    Hi gurus,

    I have used windows media apis to capture desktop and store as movie files.
    now i need to capture desktop screen using media apis, but need the output as bmps ( not as movie files, but still need fast captures )
    as far as i understand( or searched ), WM encoder outputs only movie files.

    Is there any method to capture the desktop using Windows Media Encoder APIs and get the frames as bmps?

    Thanks in advance

    Last edited by akgalp; September 9th, 2009 at 07:01 AM.
    Reply With Quote
      #2    
    Old September 9th, 2009, 08:17 AM
    OReubens OReubens is offline
    Elite Member
     
    Join Date: Apr 2000
    Location: Belgium (Europe)
    Posts: 2,145
    OReubens  is a jewel in the rough (300+) OReubens  is a jewel in the rough (300+) OReubens  is a jewel in the rough (300+) OReubens  is a jewel in the rough (300+)
    Re: Capture desktop screenshot( as bmp) with Windows Media Encoder APIs

    Considering the type of compresion available in BMP's for truecolor images (none). And considering the current screen resolutions... Using bmp as a means for 'fast' capturing seems somewhat a bad idea as it'll be very heavily tied to the throughput of your harddisk.

    Otoh, the fact there is no compression also makes doing this easy. Simply make a BMP header once (it'll be the same for all the images unless you need to account for changes in desktop size), output the BMP header, and dump the raw screen data after it to the same file.

    See here: http://msdn.microsoft.com/en-us/libr...91(VS.85).aspx
    Reply With Quote
      #3    
    Old September 9th, 2009, 08:52 AM
    akgalp akgalp is offline
    Member
     
    Join Date: Dec 2003
    Location: Gods own country, India
    Posts: 243
    akgalp is on a distinguished road (40+)
    Re: Capture desktop screenshot( as bmp) with Windows Media Encoder APIs

    thanks

    Quote:
    Originally Posted by OReubens View Post
    Considering the type of compresion available in BMP's for truecolor images (none). And considering the current screen resolutions... Using bmp as a means for 'fast' capturing seems somewhat a bad idea as it'll be very heavily tied to the throughput of your harddisk.
    The 'fast' is around 15-20fps ..

    Quote:
    Otoh, the fact there is no compression also makes doing this easy. Simply make a BMP header once (it'll be the same for all the images unless you need to account for changes in desktop size), output the BMP header, and dump the raw screen data after it to the same file.
    See here: http://msdn.microsoft.com/en-us/libr...91(VS.85).aspx
    yes that i understand. but how to get raw data using WME?
    Reply With Quote
      #4    
    Old September 9th, 2009, 12:10 PM
    OReubens OReubens is offline
    Elite Member
     
    Join Date: Apr 2000
    Location: Belgium (Europe)
    Posts: 2,145
    OReubens  is a jewel in the rough (300+) OReubens  is a jewel in the rough (300+) OReubens  is a jewel in the rough (300+) OReubens  is a jewel in the rough (300+)
    Re: Capture desktop screenshot( as bmp) with Windows Media Encoder APIs

    Don't use WME, use GDI ?
    -> GetDIBits()

    If you want to use WME, you'll need a codec that writes the frames as bmp's... You could write your own codec for this. There may be a codec that already does this.
    Reply With Quote
      #5    
    Old September 9th, 2009, 09:09 PM
    akgalp akgalp is offline
    Member
     
    Join Date: Dec 2003
    Location: Gods own country, India
    Posts: 243
    akgalp is on a distinguished road (40+)
    Re: Capture desktop screenshot( as bmp) with Windows Media Encoder APIs

    Quote:
    Originally Posted by OReubens View Post
    Don't use WME, use GDI ?
    -> GetDIBits()
    yes, but this woudn't capture directx rendered images, and that's why we turned to WME.

    Quote:
    If you want to use WME, you'll need a codec that writes the frames as bmp's... You could write your own codec for this. There may be a codec that already does this.
    any help on this part?
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 08:16 AM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.