Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Join Date
    Apr 2007
    Posts
    108

    Unanswered: Using transparent GIF in Access?

    I want to add transparent GIF in Access however I fail every time!

    GIF shows my signature and is intended to remind on the creator of database. The background is not uniform, so I used PaintShop to create transparent image, but after using it in Access I get ugly coloured rectangle around my signature instead of just the signature.

    So can I use transparent GIF in Access or does the file have to be in some other format!

    P.S. I tried using search but the only search that meets "transparent GIF" ends up "Empty thread"???

    Thanks!

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

  3. #3
    Join Date
    Apr 2007
    Posts
    108
    I followed all instructions and did it more than once but the end result is still an image with the ugly and undesired background!

  4. #4
    Join Date
    Dec 2006
    Location
    Momence, IL USA
    Posts
    56
    As far as I know, GIFs are 256 color (8-bit) images which can have only one color set to be the transparent color. (That's the way it used to be.)
    Are you sure all the background pixels are the same value? If you have a 24-bit image with a white background that you convert to GIF, some of the pixels may not be pure white - RBG(255,255,255)
    If some of the red, green, or blue values are 247 or 239 the background will still look pure white to the eye, but it won't work as a transparent background.
    You probably know all this already, but I'm just making sure.
    I use Paint Shop Pro mostly. To make sure my image has a solid background color, I form a new image of the correct size that is all one solid color. Then I use the "Magic Wand" selection tool to select only the desired "content" and paste that onto the solid background color.

    You said "the background is not uniform". It has to be made uniform to work correctly, and many images with good color depth can't be made to look good and be transparent at the same time.
    BTW, where in Access are you putting the image? On a form (grey?) or report (white)?
    Don't Bogart That Squishee!

  5. #5
    Join Date
    Apr 2007
    Posts
    108
    Thanks a-dam for your effort but I think that I got all the components right and yet the end result is missing.

    You said "the background is not uniform".
    I meant background of Access form is not uniform and this is exactly why I need transparent gif, otherwise if I had one-colored background I could easily make an image in Paint Shop with that color as background and the end user woudn't know the difference between background of the form and background of the image.

    I use Paint Shop Pro mostly. To make sure my image has a solid background color, I form a new image of the correct size that is all one solid color. Then I use the "Magic Wand" selection tool to select only the desired "content" and paste that onto the solid background color.
    I use exactly the same procedure in the same program package -> Paint Shop Pro!

    Make background uniform -> for example flourescent green, paste or draw image ->

    File -> Export -> GIF Optimizer -> Use transparency ->

    Pick a background colour to be transparent ( in this case flourescent green ) ->

    Save as GIF!

    And it doesn't work!

  6. #6
    Join Date
    Apr 2007
    Posts
    108
    No takers on this one?

    I find this one of the most irritating features of Access when trying to design good looking forms!

  7. #7
    Join Date
    Apr 2004
    Location
    Kingsland, Georgia
    Posts
    231
    And if you were to view this .gif in internet explorer, it looks like it should?

    I tried the inst. in the lebans site, (paste into word, copy it, paste to access and change background to transparent, then remove border, and make style flat), and worked perfectly.

    Try viewing it in IE or Firefox and make sure it looks like it's supposed to.

  8. #8
    Join Date
    Apr 2007
    Posts
    108
    IE shows them transparent as it should, I'll try leban's advice again!

    Must have slipped somewhere along the way!

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Since this is in the MSAccess set of threads, I'm assuming you're looking for an MSAccess solution. I've done a little bit of work with animated gifs and MSAccess. I've posted an example in the MSAccess code bank but I'm not sure if it's the solution your looking for. Although I've been able to embed animated gifs into an MSAccess form, I have not found a way to make the background transparent.

    You can find what I've been able to come up with so far here: http://www.dbforums.com/showpost.php...7&postcount=56

    If you happen to find some better solutions, please send me a PM or post it. I'd be very interested in enhancing gif animation with MSAccess.

    I have however done some neat gif animations with visual basic (with a transparent background!) I used the web activex control to do this and only 5-10 lines of code (a lot simplier code than lebans). It's been a while though as I'm mainly working with MSAccess now.
    Last edited by pkstormy; 12-10-07 at 16:16.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Apr 2007
    Posts
    108
    All I can say that after 3rd repetition of lebans process the trick worked.

    It's not elegant, you don't get to resize it and move it with ease as other controls, you don't get to align it etc. but over it's possible - in an ugly manner!

    Hopefully Access 2007 doesn't suffer from that disease!

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Out of curiosity, are you doing this in visual basic or MSAccess?

    If it's MSAccess, please post what you've found. I believe lebans solution was a vb solution but maybe I'm wrong.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  12. #12
    Join Date
    Dec 2006
    Location
    Momence, IL USA
    Posts
    56
    I couldn't get lebans system to work. It converted to an EMF, but I don't have any office apps installed (on this drive) except Access. But I do have some EMF graphics that I created previously with Word, and sure enough, they displayed correctly on an Access form. Even with the form's picture property set to a complex image, the EMF displayed transparently right on top of it. Then I tried WMF's and they worked also. So I wonder; if you have MS Word, would you even need the lebans program to convert to an EMF?
    Metafiles don't do animation, do they?
    Access forms are a weird animal. The intrinsic controls from the toolbox are just "drawn" on. I was using Spy++ to get a handle, but there wasn't any for buttons, images, textboxes... nothing. (And the handle to the window that they are drawn on is NOT Form.Hwnd) Then I thought I could just use TransparentBlt to put a graphic on the form. It worked. Showed up really nice with a transparent background. Just need to put the blit function call in the Paint event. DOH!! No Paint event!
    I found that if you put a MS Chart control on the form, every time the form repaints, the chart control fires a DonePainting event. So you can BitBlt the portion of the form that the control is covering, and TransBlt on top of that. But if you're going to do all that, you might as well subclass the form for its paint message and skip the chart control. Or just use metafiles!
    Don't Bogart That Squishee!

  13. #13
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Does it work with a .PNG

    Does it work with a .PNG
    I know that it will increse you file with factor 10 but i thought that transparent didn't work with bitmap pictures.

  14. #14
    Join Date
    Dec 2006
    Location
    Momence, IL USA
    Posts
    56
    No. I just tried a PNG and it didn't work. I've got Access 2000 & Windows 2000. I also tried transparent EMF and WMF files that I made in PSP. They didn't work. The other metafiles I have that worked must be "Office compliant" or something. Oh, even icons (.ico) show up as an ugly square on an access form when you put them on top of a picture background.
    Don't Bogart That Squishee!

  15. #15
    Join Date
    Apr 2007
    Posts
    108
    Here's what I found to be the shortest way that provides solution!

    1. Create transparent GIF (in Paint Shop: File: Export: GIF: Choose transparent color)

    2. Verify that image is transparent - open with IE!

    3. Open Word - Insert: Picture from file: Insert the desired GIF (again if GIF is transparent Word will show it in the right way)

    4. Click image, click Copy!

    5. Open Access form, right-click Paste (it will be pasted as unbound OLE and hopefully be transparent). Chose Back Style - transparent. Kill off Border and you are done!

    So, there's no need for lebans form, there's no need for conversion to EMF, there's no need to convert unbound OLE to image and you get all the control over aligning and positioning of that unbound OLE containing transparent GIF!
    Last edited by Riorin; 12-11-07 at 11:20.

Posting Permissions

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