SetAlpha Macro

Microchip Graphics Library

Microchip Graphics Library
SetAlpha Macro
C
#define SetAlpha(alpha) (_alpha = alpha)
Overview

This macro sets the alpha value. Enabling this feature requires the macros USE_ALPHABLEND_LITE defined in the GraphicsConfig.h. See USE_ALPHABLEND_LITE for information on supported primitive rendering functions.

Input Parameters
Input Parameters 
Description 
alpha 
Defines the alpha blending percentage of the new color set by SetColor() to the existing pixel color. Valid values for alpha for pure primitive layer implementation are:
  • 100 : no alpha blending, color set by last SetColor() call will replace the pixels.
  • 75 : alpha blending with new color set by last SetColor() call will be alpha blended with 75% to the existing pixel colors.
  • 50 : alpha blending with new color set by last SetColor() call will be alpha blended with 50% to the existing pixel colors.
  • 25 : alpha blending with new color set by last SetColor() call will be alpha blended with 25% to the existing pixel colors.
 
Returns

None

Side Effects

none

Example
SetAlpha(50);       // set alpha level
SetColor(BLUE);     // set color to use
Bar(5,10,30,50);    // render an alpha blended Bar 
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved