Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create a transparent rectangle with GDI+X
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01387556
Message ID:
01388269
Vues:
44
>Sure enough, I grabbed the wrong example to start with. <g> I just tried the right lightbox control and it did in fact assign itself to the grid, but there was no transparency.

Are you sure you are using SP2? I get this quite often - "How come you get transparency but I get an opaque image or nothing at all?"

The reason is that only in SP2 did they add support for loading PNG images using the PictureVal of teh image class.

Don't know why that is. Also, as in the first two attempts, the drawing of the png is annoyingly slow. My machine's a core 2 duo with a fast video card, so it should be pretty quick.

Everything should run almost instantaneous. Can you tell me exactly what you see when you run the sample form?

In the sample form, you will see that there is an instance of the class embedded. This is called from the "Toggle" button :
ThisForm.Container1.Lightbox1.Display(.F.,This.Value)
It also has the custom property "maskfile" = None. In this case it uses an internal image to display. Note that this image is embedded in the class itself as an XML string and is extracted to your Temp directory on INIT. This could be on area to look at for slowness.

The main form also uses an instance and the only difference is that this uses an external PNG file, also in the download called "MyMaskFile.png". This is a copy of the same file embedded except it is also called differently:
ThisForm.lightbox1.Display(.F.,.T.)
The slowness could be that it is trying to find this MyMaskFile.PNG file and failing?
It could also be some sort of permissions issue with your Temp directory?

>
>I've set the backcolor of the grid's columns in the short term, but it doesn't have the same polished effect as what you've done with the lightboxes.
>
>Any thoughts?

So if you are using SP2 then you have 2 options.

1. Leave the maskfile property blank and the internal image will be used.
2. Make sure the file MyMaskFile.png is in the default directory or path and leave the property blank. This works for any sp version of VFP 9since it uses the local PNG to display.

Note that GDI+x is not needed to use this above class.

If you want to go the full visual Hog so as to speak then the "top of the range" is this class which does use GDI+x
and does a gradual fading like when you log off XP.

http://weblogs.foxite.com/bernardbout/archive/2008/09/25/6871.aspx

HTH

Bernard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform