Saving a part of screen into a file fast!

This is a discussion on Saving a part of screen into a file fast! within the C++ Programming forums, part of the General Programming Boards category; How do I save a part of the screen (VGA) into the disk as a file very fast (like BSAVE ...

  1. #1
    Zap
    Zap is offline
    Registered User
    Join Date
    Jun 2003
    Posts
    1

    Cool Saving a part of screen into a file fast!

    How do I save a part of the screen (VGA) into the disk as a file very fast (like BSAVE of QBASIC) and load it very fast (like BLOAD of the same)?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Depends on the OS and depends on the compiler.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    70
    you can save screen in terms of array of bytes. Screen memory starts from 0xB800.

    Each pixel contains 2 bytes. First byte contains character and second contains it's appearace just like its color.

    For example if you want to save first line of your screen having 640x480 resolution. You have to pick 640*2 = 1280 bytes from address 0xB800.
    Chintan R Naik

  4. #4
    jasondoucette.com JasonD's Avatar
    Join Date
    Mar 2003
    Posts
    278
    For VGA mode 13h (320 x 200 x 256 colors), the memory address is 0xA0000 (A000:0000 in segment : offset), and each pixel is only 1 byte. So, it also depends on which video mode you are using.

  5. #5
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Also, you're not guaranteed to even be ABLE to directly read/write video memory in most modern operating systems; that violates the driver model.

    What platform/OS? Under Windows, you can use GDI functions. You could even use DirectX if you want to be really fancy.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 11:39 PM
  2. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 04:44 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM

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