Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying a web image on a form
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01437844
Message ID:
01437872
Views:
68
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform