Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1532

Making Picturebox transparent,Set Alpha Channel Image

$
0
0
Making Picturebox transparent(support PNG alpha)

https://forums.codeguru.com/showthre...ox-transparent
Quote:
My transparent approach now is to let UserControl Transparent and supports container functionality
Programming Challenge:How to make Picturebox1 control truly transparent.Remove the background color, set the transparency of the PNG channel as a background image function.
Code:

SetWindowLong Picturebox1.hwnd, GWL_EXSTYLE, GetWindowLong(Picturebox1.hwnd, GWL_EXSTYLE) Or WS_EX_TRANSPARENT
    Set mSubclass = New clsTrickSubclass
    mSubclass.Hook Me.hwnd

VB6 Transparent Textbox By API(WM_CTLCOLOREDIT)
https://www.vbforums.com/showthread.php?891144-VB6-Transparent-Textbox-By-API(WM_CTLCOLOREDIT)

Quote:

Originally Posted by iPrank View Post
@Napoleon,
You can do so without regioning - by using a transparent usercontrol instead.

1. Create a UserControl.
2. Set it's ControlContainer = True and BackStyle = Transparent
3. FILL the usercontrol with a Rounded Rectangle shape. (For smoother effect,set the Shape's BorderStyle to Transparent.)
4. Set the shape's FillStyle to Solid.
5. Now use this user control as the container of your WebBrowser Cotrol.


PS. It is better idea to create a new thread (with link to the original one) rather than digging up an old one. :)
(Possibly CodeBank threads are only exceptions)

https://www.vbforums.com/showthread....e-Transparency

Viewing all articles
Browse latest Browse all 1532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>