How do I make a picture to have a transparent background ??
Printable View
How do I make a picture to have a transparent background ??
You could use an Imagebox or have the Picture's border style to None.
Or this code which will make any control (with a hwnd) transparent:
Code:Private Const WS_EX_TRANSPARENT = &H20&
Private Const GWL_EXSTYLE = (-20)
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Function MakePictureTransparent(PicCtl As Object) As Boolean
On Error Resume Next
PicCtl.BackColor = PicCtl.Parent.BackColor
SetWindowLong PicCtl.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
MakePictureTransparent = Err.LastDllError = 0
End Function
Usage
MakePictureTransparent Picture1