yeah on Win 2k and XP it's easy using layers but on win98 there are two ways that I know of. I placed both ways into one function for your choice.
VB Code:
Option Explicit
Public Enum iMode
AlphaBlendingDLL = 1
msimg32DLL = 2
End Enum
Public Type BLENDFUNCTION
BlendOp As Byte
BlendFlags As Byte
SourceConstantAlpha As Byte
AlphaFormat As Byte
End Type
Public Declare Function AlphaBlending Lib "Alphablending.dll" _
(ByVal destHDC As Long, ByVal XDest As Long, ByVal YDest As Long, _
ByVal destWidth As Long, ByVal destHeight As Long, ByVal srcHDC As Long, _
ByVal xSrc As Long, ByVal ySrc As Long, ByVal srcWidth As Long, ByVal srcHeight As Long, ByVal AlphaSource As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Public Declare Function AlphaBlend Lib "msimg32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal WidthSrc As Long, ByVal HeightSrc As Long, ByVal blendFunct As Long) As Boolean
Public Sub Blend(Destination As Object, Source As Object, Amount As Integer, in_iMode As iMode)
Use Blend PictureDestination, PictureSource, 120, AlphaBlendingDLL for the 1st method
Use Blend PictureDestination, PictureSource, 120, msimg32DLL for the 2nd method
Make sure all pictureboxes are set to autoredraw and are scaled in pixels. Also you SHOULD have msimg32.dll on your pc, but you might not have Alphablending.dll, so i'll attach it. Put the Alphablending.dll into your system folder. Also source and destination could be a form, not a picturebox but make sure autoredraw is on and form is scaled to pixels.
Last edited by Dmitri K; Jan 3rd, 2005 at 08:31 PM.