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.254 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 ![]() Dieter Otter PopUp-Menü wird nicht angezeigt :-( In diesem Tipp verraten wir Ihnen, wie Sie Probleme mit PopUp-Menüs umgehen können, wenn diese unter bestimmten Umständen einfach nicht angezeigt werden. Neu! sevCoolbar 3.0 ![]() Professionelle Toolbars im modernen Design! Mit sevCoolbar erstellen Sie in wenigen Minuten ansprechende und moderne Toolbars und passen diese optimal an das Layout Ihrer Anwendung an (inkl. große Symbolbibliothek) - für VB und MS-Access |
||||||||||||||||||||||||||||||||
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. |