VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Alpha Channel (Transparency) Class

by Ed Preston (3 Submissions)
Category: Graphics
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

Visual basic class for setting the layered window attribute and alpha channel of a form (or anything else with a window handle -> hWnd). Effectively makes the form and all its contents transparent. Implements configurable levels of transparency dictated by the caller. Pass the window handle of the form to set the alpha chanel. Turn alpha on and off using bolSetAs parameter. For the alpha value, 0 is completely transparent and 255 is opague. Be carefull when using values less than 100. Compatible with User32 DLL in Windows 2000 and XP.

Inputs
SetLayered(ByVal hwnd As Long, Byval bolSetAs As Boolean, Byval bAlpha As Byte) ReleaseDisplay(ByVal hwnd As Long)
Assumes
Compatible with User32 DLL in Windows 2000 and XP.
Side Effects
Be carefull when using values less than 100.
API Declarations
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function RedrawWindow Lib "user32" _
(ByVal hwnd As Long, _
lprcUpdate As RECT, _
ByVal hrgnUpdate As Long, _
ByVal fuRedraw As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hwnd As Long, _
ByVal crKey As Long, _
ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long

Rate Alpha Channel (Transparency) Class

Download Alpha Channel (Transparency) Class

Download Alpha Channel (Transparency) Class (4 KB)

Alpha Channel (Transparency) Class Comments

No comments have been posted about Alpha Channel (Transparency) Class. Why not be the first to post a comment about Alpha Channel (Transparency) Class.

Post your comment

Subject:
Message:
0/1000 characters