AlphaImage Class
Use the AlphaImage Web control to render PNG images in Microsoft Internet Explorer.
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.AlphaImage
Microsoft.SharePoint.WebControls.ViewIcon
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.AlphaImage
Microsoft.SharePoint.WebControls.ViewIcon
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
AlphaImage
Description
The Microsoft.SharePoint.WebControls.AlphaImage class inherits from the Microsoft.SharePoint.WebControls.SPControl class which serves as the base server control for SharePoint WebControls. The AlphaImage class provides a control that allows you to conditionally display transparent PNGs taking into account browser limitations, which is problematic with antiquated browsers such as Internet Explorer Version 6.
The control works by performing modest browser tests by using SPUtility.IEVersion, along with other minimal examinations. If the browser is found to be unsupported for appropriate display, then the standard HTML image tag is not used for rendering, however a supported JavaScript method supplied by the init.js file is instead leveraged. This supplies the displayPNGImage method, which will add the image to a temporary array. In the body load wrapper script, the b method will call this array which loops through rendering each image out with a standard CSS alpha filter to fully support transparent PNGs.
Usage Scenario
The AlphaImage class certainly has heavy internal representation, notably in classes such as Microsoft.SharePoint.WebControls.ViewIcon class. However, it is exceedingly accommodating when building WebParts that include transparent images and the client browser requirements are not consistently established.
Since the AlphaImage is a customary WebControl, it can purely be instantiated and then added to the current instance control collection. This assumes that all the appropriate JavaScript intiatives are in place.
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
The Microsoft.SharePoint.WebControls.AlphaImage class inherits from the Microsoft.SharePoint.WebControls.SPControl class which serves as the base server control for SharePoint WebControls. The AlphaImage class provides a control that allows you to conditionally display transparent PNGs taking into account browser limitations, which is problematic with antiquated browsers such as Internet Explorer Version 6.
The control works by performing modest browser tests by using SPUtility.IEVersion, along with other minimal examinations. If the browser is found to be unsupported for appropriate display, then the standard HTML image tag is not used for rendering, however a supported JavaScript method supplied by the init.js file is instead leveraged. This supplies the displayPNGImage method, which will add the image to a temporary array. In the body load wrapper script, the b method will call this array which loops through rendering each image out with a standard CSS alpha filter to fully support transparent PNGs.
Usage Scenario
The AlphaImage class certainly has heavy internal representation, notably in classes such as Microsoft.SharePoint.WebControls.ViewIcon class. However, it is exceedingly accommodating when building WebParts that include transparent images and the client browser requirements are not consistently established.
Since the AlphaImage is a customary WebControl, it can purely be instantiated and then added to the current instance control collection. This assumes that all the appropriate JavaScript intiatives are in place.
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
- 6/3/2010
- Adam Buenz - MVP