My.ADVISOR.com Sign-In
ID
Password

Member Center / Sign-Up
Go to Article
Advanced Search 

VISUAL FOXPRO ADVISOR TIPS

Maintain Transparency in GIF Images in Visual FoxPro

VFP has supported transparency in GIFs since version 6 -- but only for the Image control. Here's how to get around that.

By Mike Lewis, contributing editor


A developer I know recently purchased a set of high-quality GIF images to adorn the buttons in his application. But although all the GIFs included a transparent background layer, VFP insisted on rendering each of the images with a white rectangle as the background. He asked me how he could get VFP to respect the images' transparency.

VFP has supported transparency in GIFs since version 6 -- but only for the Image control. However, if you use a given image more than once in an application, VFP only stores one copy of it. If that copy happens to be in an Image control, then other copies will respect the transparency.

The trick then, is to create an Image object before you instantiate any of the other controls that use the GIF. The image doesn’t have to be visible, and doesn’t even need to be retained after it’s been created. For example, if you execute the following code:

loImg = CREATEOBJECT("Image")
loImg.Picture = "Customer.GIF"
RELEASE loImg

then all subsequent uses of the GIF in question will respect the transparency.

-- Mike Lewis, contributing editor

Maintain Transparency in GIF Images in Visual FoxPro

No reader comments ... yet.

    What do YOU think about this topic? Share your advice and thoughts using this form.

    Your Name

    REQUIRED : PUBLIC

    Your E-Mail

    REQUIRED : PRIVATE

    Job, Company

    OPTIONAL : PUBLIC

    City, State, Country

    OPTIONAL : PUBLIC

    Your Web Site

    OPTIONAL : PUBLIC

    Your Comment

    Please help everyone by keeping your comments on-topic, using clean language, and not defaming or making personal attacks.


    Your e-mail address is required, but it will not be displayed to the public or given to anyone. See our Privacy Policy. Comments become visible after they pass our spam filter, and spammers and abusers are permanently blocked. Please report spam or abuse.

    Mike Lewis is a Visual FoxPro developer and trainer. Based in Scotland, he runs Visual FoxPro training courses for clients throughout Europe and the USA. http://www.ml-consult.co.uk

    Printer-friendly
    page layout

    Keyword Tags: Microsoft Visual FoxPro, Programming

    ADVISORAMA
    When we quarrel, how we wish we had been blameless.
    -- Ralph Waldo Emerson (1803-1882)

    ARTICLE INFO

    DataBased Advisor

    Web Edition: 2008 Week 09, Doc #19405

    FREE ACCESS FREE ACCESS

    SUBSCRIPTION STATUS
    You are not signed-in. If you are a subscriber to this publication, sign-in above to access locked articles. To subscribe or renew go to www.AdvisorStore.com.

    Subscribe to DATABASED.ADVISOR.com

    Get it all -- the most popular ADVISOR tech/business publications are now merged into one subscription, with new articles and a huge reference library packed with expert advice, how-to and downloads. Subscribe now to get it all.

    DataBased.Advisor.com

    Subscribe to FileMaker Advisor Magazine

    Read the advanced guide to creating custom business database solutions with FileMaker software. Subscribe now to gain access to all the archives and downloads.

    FileMaker.Advisor.com

    Subscribe to Advisor Basics of FileMaker Pro

    Learn the fundamentals of using FileMaker Pro software. Every issue gives you step-by-step instructions on creating the databases you need. Subscribe now!

    FileMaker.AdvisorBasics.com

    Showcase Your Smarts

    Submit your tips, techniques and advice and let Advisor promote your business and build your career. Show the world what you know!

    AdvisorTips.com

    Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
    Portions copyright ©1983-2008 Advisor Media, Inc. All Rights Reserved.
    Reuse or reproduction of any portion or quantity of Advisor Media's copyrighted content, in any form, for any purpose, requires written permission.
    ADVISOR®, the ADVISOR logo, and other names and logos that incorporate ADVISOR are registered trademarks, trademarks or service marks of Advisor Media, Inc. in the United States and/or other countries.
    Other trademarks are used for identification, editorial or descriptive purposes and are the property of their owners.
    Hosted by Prominic.NET Website powered by
    LOTUS SOFTWARE
    lewim57 posted 02/25/2008 modified 01/09/2009 03:36:07 AM ztdbms/ztdbms
    domino-144.advisor.com my.advisor.com 01/09/2009 04:22:10 PM