Set shell transparency

Source: Internet
Author: User

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 );
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.