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:
01388271
Vues:
50
>Bernard, I did find what the original problem was. It seems that if the form has a grid on it, adding the lightbox control makes the grid appear as an empty container. That's why when it overlays the grid it appears non-transparent. The effect is the same as when a grid loses its record source.
>
>-m@

Ahh You cannot add controls to a grid, only to the columns in the grid, hence the grid is not your ideal control for this.

The class is very simple. All it does is display a transparent image MyMaskFile.Png and size it to the dimensions provided.

I suggest you not use this class for your grid but use the image in the downlaod - MyMaskFile.Png and a vfp image class and set its picture to this image. Also set the STRETCH = 2 and visible = .F. Make this a class and add a DisplayLightBox method to it.

In the method you can accept an object as a parameter.
In your code you first size the image to the object size, set Zorder(0) and then make the image.Visiibe = .T. or .F. to show or hide it.
Pretty easy to do. At its simplest would be like this:
* DisplayLightBox()
LPARAMETERS toObject
* toObject = the object to "mask"
WITH this
	.Top = toObject.Top
	.Left = toObject.Left
	.Height = toObject.Height
	.Width = toObject.Width
	.Zorder(0) 
	.Visible = NOT .Visible
        toObject.Enabled = NOT  toObject.Enabled  && disable object so it cannot get focus.
ENDWITH
and call the above ThisForm.MySplClass.DisplayLightbox(ThisForm.MyGrid)

Note that the code above is a toggle. Call for on call for off.

HTH

Bernard
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform