Click to See Complete Forum and Search --> : transparent image or picture
farah
May 31st, 2000, 10:36 PM
Hi everyone,
I am dragging the image control in visual basic 6 and put it in the form and tried to set it to transparent but I coud not find the right property to do this. Also I tried it with the picture control and could not. Can someone help or give a hint in how to make the image or picture control transparent (I mean you can see other buttons or texts through the image but can not click on the buttons and textboxes). Thanks for any hint or help.
Fox
May 31st, 2000, 11:54 PM
I think you're looking for a sprite control, if so download it from my website (http://foxmccloud.tsx.org)...
Use BitBlt, and choose not to copy Black or White and have you backcolour of the picture set to Black or White so then it will appear transparent.
farah
Jun 1st, 2000, 04:50 AM
Originally posted by Megatron
Use BitBlt, and choose not to copy Black or White and have you backcolour of the picture set to Black or White so then it will appear transparent.
How can I use BitBlt? can you help here. Thanks
Public Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (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 dwRop As Long) As Long
Fox
Jun 1st, 2000, 05:16 AM
Look here (http://forums.vb-world.net/showthread.php?postid=61849#post61849)
Or refer to your other topic about BitBlt.
http://forums.vb-world.net/showthread.php?threadid=18247
farah
Jun 1st, 2000, 07:56 AM
Originally posted by Fox
Look here (http://forums.vb-world.net/showthread.php?postid=61849#post61849)
You Have a very cool and useful site.
I looked at your sprite control.
Can I make the sprite to cover any buttons on the screen , still can see the buttons , and can not click on the buttons.
I tried to make it very big and bring to infront but it did not work.
Thanks for any hint or help.
Fox
Jun 1st, 2000, 08:45 AM
Im actually not sure if I did right-understand what you mean...
Well, the clipping on my sprite is set to 1 (region). That means you can only click on the visible pixels of the picture you load into it. If you want rectangular clipping just set its ClipBehavior property to 0.
farah
Jun 1st, 2000, 10:22 AM
Originally posted by Fox
Im actually not sure if I did right-understand what you mean...
Well, the clipping on my sprite is set to 1 (region). That means you can only click on the visible pixels of the picture you load into it. If you want rectangular clipping just set its ClipBehavior property to 0.
May be I have a problem in creating a transpatent file for vb 6! (empty file with transparent format)
OK!, let me tell you what I really want:
1. I would like your sprite to be transparent
2. Lets say, I create a form with a command1 (button)
and your sprite over command1 button inside the form.
3. I make a transparent file using Microsoft photo
editor with gif format. Can you email me one. Maybe I am not doing it correct.
4. I called the gif (or what evere extention file) with its path like he following
c:\transparent.gif
5. I put the following code in my form level:
Private Sub Form_Load()
Sprite1.Picture = "c:\transparent.gif"
End Sub
6. when I run the project, I am suppose to get your sprite as a transparent object over the command1 button. Also I am suppose to see the command1 button but can not click on it because your sprite is suppose to be over the button and prevent me form doing clicking on the button.
Well, What I really want is anything (let say your sprite)to cover Command1 button and can not click on it and still can see it (comand1 button) through your sprite.
I hope, I made you understand. Thanks very much for your help.
Fox
Jun 1st, 2000, 10:44 AM
I think Ive got it.
Well, take my sprite, load a BITAMP into it, transparent color is RGB(255,255,0) for default. Then set the Sprites ClipBehavior to 0 (you have to edit the usercontrol for this). I think thats what you need.
(Are you making a cross on the button ;))
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.