Allegro & screen capture

This is a discussion on Allegro & screen capture within the Game Programming forums, part of the General Programming Boards category; Brief: How would I go on saving a part of the screen (to memory - not a disk) and then ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    129

    Allegro & screen capture

    Brief: How would I go on saving a part of the screen (to memory - not a disk) and then displaying it afterwards.
    kooma - t.h@iki.fi

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    PHP Code:
    ...
    // Make a variable to store it.
    BITMAP *screen_shot;
    ...
    main()
    {
    ...
    // Allocate memory to the variable.
    screen_shot create_bitmap(size_xsize_y);

    // Blit the screen part you want to the variable.
    // This is presuming you are using "screen" for your screen.
    blit(screenscreen_shotsource_xsource_y00size_xsize_y);

    ...

    // Blit it back on to the screen.
    blit(screen_shotscreen00dest_xdest_ysize_xsize_y);
    ...
    }
    END_OF_MAIN(); 
    Note that blit allows you to stretch the image by making the sizes not match up with the actual image. This allows you to, say, have the image stretch into shape from a vertical or horizontal line, for instance.

    For having transparent color in the image, see draw_sprite() and other functions in the Blitting documentation.

    -Justin
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    129
    So that's the sort of BITMAP copier I've been looking for...
    kooma - t.h@iki.fi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screen Capture Applications
    By SlyMaelstrom in forum Tech Board
    Replies: 0
    Last Post: 12-18-2006, 08:17 PM
  2. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 04:56 PM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  4. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 03:41 AM
  5. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-21-2002, 12:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21