Results 1 to 5 of 5

Thread: transparent gif in vb?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    if it possible to open a transparent GIF in VB so like if I load the gif into a picture box, then put the picture box over a command button, it would show the picture box, and the back ground of the gif would show the command button (I'm using Microsoft Photo Editor to make the back ground transparent)
    NXSupport - Your one-stop source for computer help

  2. #2
    Guest
    Set the command button's style to 1-Graphical and you can use pictures.

  3. #3
    Guest
    If you're placing it in a PictureBox then the background will not be transparent, however it will be if you use an Image instead.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    matt, thats not what I meant

    Megatron: thanks, now is there I way that I can get the image to go ontop of the command button?
    NXSupport - Your one-stop source for computer help

  5. #5
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    I've mentioned this somewhere else before but here goes again.


    When you load a GIF into an Image control it implicitly converts it to the BMP format.

    If your GIF had a transparent background then as part of the conversion it will also set the MaskColor to be the same as your transparent colour in the GIF and thus maintain transparency.

    You do have to take a few considerations into account though.

    Firstly you can only load it into controls that support Transparent backgrounds by nature (ie have a Background or similar attribute selecting 0-Opaque, 1-Transparent).

    Secondly If you then copy or duplicate this image from where you FIRST loaded it into any other control, imagelist or ANYTHING else then you have lost the transparent background unless you manually set the MaskColor in the place where you copied it to.

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