mer. 17 mai 2023, 23h51
BENMAHAMMED
Algérie
atoutfox.public.association
Re: Re=3a Insertion d'une image dans la fen=c3=aatre principal de visual foxpro
* Program....: SET_APPIMAGE.PRG
LPARAMETER p_cImageName
WITH _screen
**-- Ajouter un objet image
*
IF VARTYPE(.myPic) = "O"
.RemoveObject('myPic')
ENDIF
.cls()
.AddObject('myPic','image')
**-- Définir la propriété de l'image
*
.myPic.Picture = p_cImageName
.myPic.stretch = 1 &&
l_nAspectRatio = .MyPic.Height/.MyPic.Width
SI (.Height/.Width) <= l_nAspectRatio
.MyPic.Height = .Height
.MyPic.Width = .Height / l_nAspectRatio
ELSE
.MyPic.Width = .Width
.MyPic.Height = .Width / l_nAspectRatio
ENDIF
**-- Centrer le contrôle et l'afficher
*
.MyPic.Top = (.Height * .5) - (.myPic.Height * .5)
.MyPic.Left = (.Width * .5 ) - (.myPic.Width * .5)
IF !EMPTY(.myPic.Picture)
.myPic.Visible = .T.
ENDIF
ENDWITH &&* _screen
*!* EOP : SET_APPIMAGE.PRG
Rick
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000020106