CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Gods own country, India
    Posts
    248

    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 06:01 AM.

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    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

  3. #3
    Join Date
    Dec 2003
    Location
    Gods own country, India
    Posts
    248

    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 ..

    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?

  4. #4
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    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.

  5. #5
    Join Date
    Dec 2003
    Location
    Gods own country, India
    Posts
    248

    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.

    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?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured