Results 1 to 6 of 6

Thread: Screen Capture with ClanLib 2.0.3

  1. #1
    Peasant
    Join Date
    Apr 2009
    Location
    Brazil
    Posts
    6

    Default Screen Capture with ClanLib 2.0.3

    Hi,

    Actualy I'm working on platform Windows XP, developing a Screen Capture software that must have image processing support.
    I've researched over the internet and I finally found a solution using Direct3d but I need to access the D3D device.

    Do the ClanLib has any method to get the device? And How to trasform a D3D surface in something renderable like CL_Texture?


    Thanks

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I don't understand why you need a D3D device to perform a screen capture?

    To screen grab the entire screen is out of the ClanLib's scope (in my opinion).

    To grab a clanlib window, it's very simple:

    Code:
    	CL_PixelBuffer screen = gc.get_pixeldata(CL_Rect(0, 0, CL_Size(gc.get_width(), gc.get_height())));
    	CL_PNGProvider::save(screen, "image.png");
    Except the image is upside down - I'm not sure if this is a bug. But it should be easy to reverse the image anyway.

    (See attached image)

    If you want to create an animation, I would feed the CL_PixelBuffer into "IWMWriter" - That's a part of the Windows Media Format 11 SDK.
    (That's how I do it)
    Attached Images Attached Images  

  3. #3
    Peasant
    Join Date
    Apr 2009
    Location
    Brazil
    Posts
    6

    Default

    Thanks, rombust

    I'll find out how to do this.

  4. #4
    Lesser Knight
    Join Date
    Mar 2009
    Posts
    54

    Default Easy fix

    Just grab the image twice like so:

    CL_PixelBuffer buffer = gc.get_pixeldata();

    gc.clear();
    gc.draw_pixels(0.0f,0.0f,buffer);
    buffer = gc.get_pixeldata();
    CL_ImageProviderFactory::save(buffer, path);
    gc.clear();
    gc.draw_pixels(0,0,buffer);

    It should be the rightside up now

  5. #5
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    lol

    It should be fixed though, in my opinion.

  6. #6
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Fixed in the upcoming ClanLib 2.0.5

Similar Threads

  1. Clanlib 0.8.1 Full screen mode under SDL
    By babyvegas in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-28-2009, 12:02 PM
  2. Stuck on the first screen?
    By in forum Funeral Quest
    Replies: 1
    Last Post: 01-18-2006, 10:35 AM
  3. Full Screen
    By in forum Dink Smallwood HD
    Replies: 2
    Last Post: 04-15-2005, 06:29 AM
  4. Can't get into inventory screen
    By in forum Dink Smallwood HD
    Replies: 1
    Last Post: 08-25-2004, 11:22 PM
  5. purple screen
    By maarten_de_zoveelste in forum Dink Smallwood HD
    Replies: 2
    Last Post: 10-16-2003, 07:48 AM

Bookmarks

Bookmarks

Posting Permissions

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