Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying a web image on a form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01437844
Message ID:
01437872
Vues:
67
This message has been marked as a message which has helped to the initial question of the thread.
The Image control can be sub-classed to do that:
LOCAL oForm As TForm
oForm=CREATEOBJECT('TForm')
oForm.Show(1)
* end of main

DEFINE CLASS TForm As Form

	ADD OBJECT Image1 As WebImage WITH;
	Left=10, Top=10

PROCEDURE Init
	THIS.Image1.Picture='http://www.news2news.com/vfp/images/w32logo1.gif'

ENDDEFINE

DEFINE CLASS WebImage As Image

PROCEDURE Picture_ASSIGN(cUrl As String)
	DECLARE INTEGER URLDownloadToCacheFile IN urlmon;
		INTEGER lpUnkcaller, STRING szURL, STRING @szFileName,;
		INTEGER dwBufLength, INTEGER dwReserved, INTEGER pBSC

	LOCAL cCacheFile
	cCacheFile=REPLICATE(CHR(0),260)

	IF URLDownloadToCacheFile(0, m.cUrl,;
		@cCacheFile, LEN(cCacheFile), 0,0) = 0
		THIS.Picture=m.cCacheFile
	ENDIF

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

Click here to load this message in the networking platform