could anyone direct me to a way of removing all the whiteness in a picture box from so i can drag it over another picture box with transparency
ive uploaded a picture of some eyes as an example
Printable View
could anyone direct me to a way of removing all the whiteness in a picture box from so i can drag it over another picture box with transparency
ive uploaded a picture of some eyes as an example
One way is to use a UserControl, any color in the image that matches the MaskColor should appear transparent.
Or using a picbox inside the control,Code:Option Explicit ' UserControl code
' Add an image to the UserControl Picture property.
Private Sub UserControl_Initialize()
UserControl.BackStyle = 0 ' transparent UC
Redraw
End Sub
Public Sub Redraw()
UserControl.MaskColor = vbWhite ' Make white transparent
UserControl.Picture = UserControl.Image
Set UserControl.MaskPicture = UserControl.Image
End Sub
BTW, You'd need to clean up your eyes image, that white area needs to be a solid color.Code:Option Explicit ' UserControl code
' Add an image to Picture1 picture property.
Private Sub UserControl_Initialize()
Picture1.BorderStyle = 0
Picture1.Visible = False ' hide the pic box
UserControl.BackStyle = 0 ' transparent UC
Redraw
End Sub
Public Sub Redraw()
UserControl.Cls
UserControl.MaskColor = vbWhite ' Make white transparent
UserControl.Picture = Picture1.Image
Set UserControl.MaskPicture = Picture1.Image
End Sub
thanks verry much for your answer
will this only work with .gif
Should work with any image that the picture property supports.Quote:
Originally Posted by Rattled_Cage
If you use a Gif that has transparency you could use VBs Image control.