Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fading an image

Status
Not open for further replies.

MalcUK

Programmer
Apr 24, 2003
19
GB
Here is a tough one. I want to be able to fade a jpg image on the form. It's easy to do this on a web page by setting opacity but how about in VFP? There isn't a property like that on an image control, but is there something using Activex or API that would do this?

BTW I cant do it by creating a fading GIF or AVI image because the image is selected by the user from a library of existing jpegs.
 
MalcUK
It all depends on the version of VFP and the version of windows you are using. There is an example of "transprency" in the solutions provided with VFP (It requires minimum w2000)
C:\Program Files\Microsoft Visual FoxPro 7\Samples\Solution\Sedona\fadeaway.scx


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
If you want this to be more compatible and just have the image faded then you will need to either create a faded graphic on the fly that is used for the display to the user or you will need to use an activex control that has the ability to show images with different transparency/opacity settings. There's really no other way that I know of. As Mike has already pointed out, if you do it using the Windows API calls then it is then contingent on VFP being a certain version and Windows being a certain version...which might work for a one-off program that is used ona specific environment that you can control, but is not a good solution for a program that will be distributed in mass...those kind of System Requirements would still be deemed too restrictive...though I pray for the day when no one (or at least so few to matter) is running Windows 95/98/ME anymore.

boyd.gif

 
Words of wisdom from Craig and Mike. Yeah, although I use XP I cant guarantee that others wont still be using 98 :(

The VFP example fadeaway.scx fades a form, not an image, but I think I might be able to get round that by creating a borderless form to hold the jpeg, though I'll have to stop the user from moving the background form - or somehow move the image form at the same time. (I'll test for nonXP versions and just show the non fading version.) FUN FUN FUN!

Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top