SAMPLE: Simulating Palette Animation on Non-Palette Displays

Last reviewed: February 15, 1996
Article ID: Q130476
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT version 3.5
    

SUMMARY

LAVALAMP is a sample application in the Microsoft Software Library that demonstrates how to simulate the effects of the AnimatePalette() function on devices that may not support palettes. This program also demonstrates how to create and manipulate dibsections. The following dibsection functions are used in LAVALAMP:

   CreateDIBSection()
   GetDIBColorTable()
   SetDIBColorTable()

Download LAVALAMP.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download LAVALAMP.EXE (size: 28464 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get LAVALAMP.EXE (size: 28464 bytes) 
    

MORE INFORMATION

When running in display modes that are not palette-based, many of the effects that can be performed easily with palette animation need to be reprogrammed. A simple method of simulating palette animation can be achieved by "animating" a device-independent bitmap's (DIBs) color table and redisplaying the DIB with the new colors. To demonstrate this technique, LAVALAMP creates an 8-bits-per-pixel (bpp) dibsection. Then it shifts each of the RGBQUAD data structures in the color table by one position to the left, and recycles the first entry in the color table to the last position. After each modification to the color table, the DIB is redisplayed.

Because the entire DIB must be redisplayed after each modification to the color table, this technique is not recommended for large bitmaps.


Additional reference words: 3.50 technote BMP softlib
KBCategory: kbgraphic kbfile
KBSubcategory: GdiBmp GdiPal


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.