Deklaration: Declare Function AlphaBlend Lib "msimg32.dll" ( _ ByVal hdcDest As Long, _ ByVal xDest As Long, _ ByVal yDest As Long, _ ByVal WidthDest As Long, _ ByVal HeightDest As Long, _ ByVal hdcSrc As Long, _ ByVal xSrc As Long, _ ByVal ySrc As Long, _ ByVal WidthSrc As Long, _ ByVal HeightSrc As Long, _ ByVal Blendfunc As Long) As Long Beschreibung: Parameter:
Rückgabewert: Beispiel: Private Declare Function AlphaBlend Lib "msimg32.dll" ( _ ByVal hdcDest As Long, _ ByVal xDest As Long, _ ByVal yDest As Long, _ ByVal WidthDest As Long, _ ByVal HeightDest As Long, _ ByVal hdcSrc As Long, _ ByVal xSrc As Long, _ ByVal ySrc As Long, _ ByVal WidthSrc As Long, _ ByVal HeightSrc As Long, _ ByVal Blendfunc As Long) As Long Private Declare Sub MoveMemory Lib "kernel32.dll" _ Alias "RtlMoveMemory" ( _ Destination As Any, _ Source As Any, _ ByVal Length As Long) Private Type BLENDFUNCTION BlendOp As Byte BlendFlags As Byte SourceConstantAlpha As Byte AlphaFormat As Byte End Type ' BlendFunction BlendOp-Konstante Private Const AC_SRC_OVER = &H0 ' die Quelle wird über dem Ziel gezeichnet ' 'BlendFunction AlphaFormat-Konstante Private Const AC_SRC_ALPHA = &H1 ' das Quellbitmap wurde schon mit dem Alphawert multipliziert ' Bildfelder einstellen Private Sub Form_Load() Picture1.ScaleMode = vbPixels Picture1.AutoRedraw = True Picture2.ScaleMode = vbPixels Picture2.AutoRedraw = True End Sub ' Alphablending starten Private Sub Command1_Click() Dim Retval As Long, LBF As Long, BF As BLENDFUNCTION ' Struktur mit Blendingwerten füllen With BF .BlendOp = AC_SRC_OVER .SourceConstantAlpha = 128 End With ' Struktur in eine Long-Variable kopieren Call MoveMemory(LBF, BF, Len(BF)) ' Alphablending-Operation durchführen With Picture1 Retval = AlphaBlend(Picture2.hDC, 0, 0, Picture2.ScaleWidth, _ Picture2.ScaleHeight, .hDC, 0, 0, .ScaleWidth, .ScaleHeight, LBF) Picture2.Refresh If Retval = 0 Then MsgBox "Das Alphablending ist fehlgeschlagen" End If End With End Sub Diese Seite wurde bereits 16.582 mal aufgerufen. |
vb@rchiv CD Vol.6 Geballtes Wissen aus mehr als 8 Jahren vb@rchiv! Online-Update-Funktion Entwickler-Vollversionen u.v.m. Buchempfehlung Tipp des Monats April 2024 Skyfloy Chart von Microsoft und dazu noch gratis Tutorial für Microsoft Chart Controls für Microsoft .NET Framework 3.5 sevAniGif (VB/VBA) Anzeigen von animierten GIF-Dateien Ab sofort lassen sich auch unter VB6 und VBA (Access ab Version 2000) animierte GIF-Grafiken anzeigen und abspielen, die entweder lokal auf dem System oder auf einem Webserver gespeichert sind. |
||||||||||||||||||||||||||||||||
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein. |