|
-
Oct 19th, 2008, 07:37 PM
#1
Thread Starter
Hyperactive Member
-
Oct 19th, 2008, 08:45 PM
#2
Re: picture help
One way is to use a UserControl, any color in the image that matches the MaskColor should appear transparent.
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
Or using a picbox inside the control,
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
BTW, You'd need to clean up your eyes image, that white area needs to be a solid color.
Last edited by Edgemeal; Oct 19th, 2008 at 09:06 PM.
Reason: UPDATED
-
Oct 19th, 2008, 10:51 PM
#3
Thread Starter
Hyperactive Member
Re: picture help
thanks verry much for your answer
will this only work with .gif
-
Oct 19th, 2008, 11:02 PM
#4
Re: picture help
 Originally Posted by Rattled_Cage
thanks verry much for your answer
will this only work with .gif
Should work with any image that the picture property supports.
If you use a Gif that has transparency you could use VBs Image control.
Last edited by Edgemeal; Oct 19th, 2008 at 11:07 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|