Results 1 to 2 of 2

Thread: operate CL_PixelBuffer as CL_Surface

  1. #1
    Lesser Knight
    Join Date
    Oct 2007
    Posts
    57

    Default operate CL_PixelBuffer as CL_Surface

    I know the example basic2d have a line:
    "CL_ProviderFactory::save(CL_Display::get_current_ window()->get_gc()->get_pixeldata(CL_Rect(100, 200, 500, 300)), filename);"

    CL_PixelBuffer saved to a file,but I want CL_PixelBuffer save as a CL_Surface,my mean is that I want the current CL_PixelBuffer save in memory and I can operate this CL_PixelBuffer as a CL_Surface,than not to save a file and load this file to a CL_Surface.

    I believe Clanlib must can do it,just I don't know.Somebody can help me?
    Thanks in advance.

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

    Default

    CL_PixelBuffer screen = gc.get_pixeldata(CL_Rect(0, 0, CL_Size(gc.get_width(), gc.get_height())));

    CL_PNGProvider::save(screen, "image.png");

Similar Threads

  1. CL_Surface draw a picture
    By DavinciZhe in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 08-08-2009, 02:01 AM
  2. ClanLib 2.0 and CL_Surface
    By falsinfab in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-16-2009, 04:45 PM
  3. Mask of CL_Surface
    By karaman in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 06-01-2008, 08:57 AM
  4. problem with CL_Surface display a PNG
    By lurker2000wxc in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 03-14-2008, 09:18 AM
  5. CL_PixelBuffer::get_pixel() weird results...
    By Otto (Strange) Halmén in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 12-06-2006, 07:36 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
  •