Publicc void setalpha (INT alpha)
Alpha range: 0 ~ 255
This method is supported from eclipse3.4.
/**
* Sets the operator's Alpha value which must be
* Between 0 (transparent) and 255 (opaque ).
* <P>
* This operation requires the operating system's advanced
* Widgets subsystem which may not be available on some
* Platforms.
* </P>
* @ Param Alpha the Alpha Value
*
* @ Exception swtexception <ul>
* <Li> error_widget_disposed-if the specified er has been disposed </LI>
* <Li> error_thread_invalid_access-if not called from the thread that created the specified er </LI>
* </Ul>
*
* @ Since 3.4
*/
Public void setalpha (INT alpha ){
Checkwidget ();
If (! OS. iswince & OS. win32_version> = OS. Version (5, 1 )){
Alpha & = 0xff;
Int bits = OS. getwindowlong (handle, OS. gwl_exstyle );
If (alpha = 0xff ){
OS. setwindowlong (handle, OS. gwl_exstyle, BITs &~ OS. ws_ex_layered );
Int flags = OS. rdw_erase | OS. rdw_invalidate | OS. rdw_frame | OS. rdw_allchildren;
OS. redrawwindow (handle, null, 0, flags );
} Else {
OS. setwindowlong (handle, OS. gwl_exstyle, BITs | OS. ws_ex_layered );
OS. setlayeredwindowattributes (handle, 0, (byte) Alpha, OS. lwa_alpha );
}
}
}