ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: Re=3a Insertion d'une image dans la fen=c3=aatre principal de visual foxpro   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

mer. 17 mai 2023, 23h51
BENMAHAMMED
Algérie 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
20 087 messages dans le forum • Liste complète des messages

Publicité

Les pubs en cours :


www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2024.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3