Simulating Palette Animation on Non-Palette Displays (130476)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • Microsoft Windows NT Server 3.5
    • Microsoft Windows NT Workstation 3.5
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Professional

This article was previously published under Q130476

SUMMARY

LAVALAMP is a sample application in the Microsoft Download Center 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()

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. 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.

Modification Type:MinorLast Reviewed:3/7/2005
Keywords:kbdownload kbFAQ kbfile kbgraphic kbinfo KB130476 kbAudDeveloper