Results 1 to 10 of 10

Thread: transparent image or picture

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 1999
    Location
    San Diego, Ca , USA
    Posts
    44
    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.

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    I think you're looking for a sprite control, if so download it from my website...

  3. #3
    Guest
    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.

  4. #4

    Thread Starter
    Member
    Join Date
    Mar 1999
    Location
    San Diego, Ca , USA
    Posts
    44

    BitBlt

    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

  5. #5
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Look here

  6. #6
    Guest
    Or refer to your other topic about BitBlt.

    http://forums.vb-world.net/showthrea...threadid=18247

  7. #7

    Thread Starter
    Member
    Join Date
    Mar 1999
    Location
    San Diego, Ca , USA
    Posts
    44

    sprite

    Originally posted by Fox
    Look here
    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.

  8. #8
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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.

  9. #9

    Thread Starter
    Member
    Join Date
    Mar 1999
    Location
    San Diego, Ca , USA
    Posts
    44

    sprite

    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.

  10. #10
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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 )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width