|
-
Oct 30th, 2002, 08:18 PM
#1
Thread Starter
PowerPoster
Transparent Picturebox / Image with a handle...
I want to display a picture over all my other controls, but with a transparent background.
The PictureBox doesn't have a bloody transparency, and the Image control won't show in front of certain controls... 
Point me in the right direction someone...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 30th, 2002, 08:19 PM
#2
The picture isn't missing
how about transparent bitblt? will that work?
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Oct 30th, 2002, 08:20 PM
#3
Thread Starter
PowerPoster
Potentially. Show me how, and I'll let you know...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 30th, 2002, 08:24 PM
#4
The picture isn't missing
this is apiguide example:
VB Code:
'This project needs 2 pictureboxes
'Picturebox1 must contain a picture with a lot of white pixels (we're going to use white as transparent color)
Private Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Boolean
Private Sub Form_Load()
'KPD-Team 1999
'URL: [url]http://www.allapi.net/[/url]
Picture1.AutoSize = True
'API uses pixels
Picture1.ScaleMode = vbPixels
Picture2.ScaleMode = vbPixels
End Sub
Private Sub Picture2_Paint()
'If we don't call DoEvents first, our transparent image will be completely wrong
DoEvents
TransparentBlt Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, vbWhite
End Sub
Requires Windows 2000 or later; Requires Windows 98 or later
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Oct 30th, 2002, 08:25 PM
#5
Thread Starter
PowerPoster
Apparently I don't have msimg32.dll on this machine (NT4 workstation).
Any other ideas?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 30th, 2002, 08:27 PM
#6
The picture isn't missing
well... i don't know how to do this, but you could use bitblt with a mask. maybe search forum.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Oct 30th, 2002, 09:01 PM
#7
Thread Starter
PowerPoster
Yeah, been doing that... I don't want to use a mask and BitBlt if I can find a more flexible way. Don't want 2 pictures for every transparent image I want... stoopid vb designers... :grrr:
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
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
|