Toon posts:

[vb] Alpha kleur.

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik zie wel is programmatjes waar je zo door het windowtje half heen kan kijken zodat je vaag de achtergrond van windows ziet. Hoe krijg ik deze (geloof alpha color)?

  • silentsnow
  • Registratie: Maart 2001
  • Laatst online: 15-04-2013

silentsnow

« '-_-' »

noemen ze dat niet gewoon transparent :?

The trade of the tools
[ me | specs ] Klipsch Promedia Ultra 5.1 + Sennheiser HD-590


Verwijderd

Topicstarter
Transparant zou ook wel kunnen.Ik bedoel niet dat het helemaal transparant moet worden hoor. ik wil door bijvoorbeeld witte licht de achtergrond zien.

  • Crazy D
  • Registratie: Augustus 2000
  • Laatst online: 09-09 16:14

Crazy D

I think we should take a look.

Als je had geweten dat dat in Windows opacity heet had je 'm in 5 seconden met google gevonden...
In .net is dat dacht ik trouwens gewoon een property :)

quote van Karl E. Peterson's One-Stop Source Shop
Shows how to create "layered" windows in Windows 2000. This demo provides a drop-in ready class that can be used to either do an Alpha-blend for translucency ranging from totally opaque to completely transparent, or the class can be used to select a single color to be rendered transparent. In either mode, the entire form and all its child controls are affected. Additional demos show how to create an irregularly shaped form using the Color Key approach to layered windows, and how to set the opacity of any window in the system. Now includes updated demos of WinRgn and WndPick, built to show off use of layered windows.
Translucent.zip

Werkt trouwens erg leuk :)

Exact expert nodig?


Verwijderd

Dit is echt wat ik nodig heb !!!

Ik zal eens met de code gaan prutsen :)

Verwijderd

Tada :) Je moet er wel ff alle overbodige enters uitslopen.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'Semi Transparent windows (2000/XP/Me?)
Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long, ByVal crKey As Long, 
ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Declare Function UpdateLayeredWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal hdcDst As Long, pptDst As Any, 
psize As Any, ByVal hdcSrc As Long, pptSrc As Any, crKey 
As Long, ByVal pblend As Long, ByVal dwFlags As Long) As Long

Public Declare Function GetWindowLong Lib "user32" 
Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex 
As Long) As Long

Public Const GWL_EXSTYLE = (-20)
Public Const WS_EX_LAYERED = &H80000
Public Const ULW_COLORKEY = &H1
Public Const ULW_ALPHA = &H2
Public Const ULW_OPAQUE = &H4
Public Const AC_SRC_OVER = &H0
Public Const AC_SRC_ALPHA = &H1
Public Const AC_SRC_NO_PREMULT_ALPHA = &H1
Public Const AC_SRC_NO_ALPHA = &H2
Public Const AC_DST_NO_PREMULT_ALPHA = &H10
Public Const AC_DST_NO_ALPHA = &H20
Public Const LWA_COLORKEY = &H1
Public Const LWA_ALPHA = &H2

Public Sub MakeTransparent(hwnd As Long, Rate As Byte)
  On Error Resume Next
  '### funktioniert nur unter Win2000 - XP!!!
  '### macht das Fenster, dessen hWnd über
  '     geben wurde, transparent
  '### Rate: 254 = normal 0 = ganz transpa
  '     rent
  '### 190 ist z.B. ein guter Wert
  Dim WinInfo As Long
  WinInfo = GetWindowLong(hwnd, GWL_EXSTYLE)
  WinInfo = WinInfo Or WS_EX_LAYERED
  SetWindowLong hwnd, GWL_EXSTYLE, WinInfo
  SetLayeredWindowAttributes hwnd, 0, Rate, LWA_ALPHA
End Sub
Pagina: 1