Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

view a .jpg via Internet Explorer 3

Status
Not open for further replies.

RussA

Programmer
Mar 19, 2003
27
US
I’m looking for an easy way to view a .jpg via Internet Explorer using FoxPro 6.0.

Thanks in advance.
 

How about:
Code:
oIE = createobject('internetexplorer.application')
oIe.Navigate2('c:\frame0.jpg')
oIe.Visible = .t.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Try Shell execute (courtesy of Mike lewis
this will open the file c:\mypic.jpg in Internet exporer

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
cFileName = "C:\Program Files\Internet Explorer\iexplore.Exe"
cAction = "open"
ShellExecute(0,cAction,cFileName,"c:\mypic.jpg","",1)


if you want to just open up the jpg in the windows associated app use:

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
cFileName = "C:\mypic.jpg"
cAction = "open"
ShellExecute(0,cAction,cFileName,"","",1)

where the application the file is opened rather then the 1st example where internet explorer was opened with the file

MrF
 
The trick here is to place a copy of your jpeg in your
temp folder, then write an html file to the same place

The HTML code you need is :

Code:
<HTML><BODY><img src='.\myfile.jpg'></BODY></HTML>

Where the ".\myfile.jpg" is your jpeg

Then use the ShellExecute function to open the html file:

Code:
FUNCTION BROWSER
	PARAMETER m.FILENAME
	LOCAL LNRETVAL, LCOPERATION
	LCOPERATION = "Open"
	IF FILE(m.FILENAME)
		DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
			INTEGER handle,;
			STRING @sFile,;
			STRING @lp,;
			STRING @DIR,;
			STRING @dir1,;
			INTEGER ncmd
		LNRETVAL = SHELLEXECUTE(0, LCOPERATION, m.FILENAME, "", "", 1)
	ELSE
		MESSAGEBOX("Unable to locate the web page:"+m.FILENAME,48,"Problem")
	ENDIF
	RETURN(.F.)

HTH

Regards

Griff
Keep [Smile]ing
 
Dave

I wonder how your suggestion that relates to loading a jpg in the internet explorer?. Can you expand?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Whoooa I was slow typing that!

Three people beat me!

Regards

Griff
Keep [Smile]ing
 
Thanks for all the help. Just one more thing, is there also a simple way to fit an over sized picture into the window?
 
Hi Russ

If you use the HTML file route, you can specify the
size you want the file to be:

Code:
<HTML><BODY><img src='.\myfile.jpg' height=100 ></BODY></HTML>

But watch out - this will EXPAND smaller images and compress larger ones!

Regards

Griff
Keep [Smile]ing
 
RussA,
I’m looking for an easy way to view a .jpg via Internet Explorer using FoxPro 6.0.
I'm just curious. Wasn't viewing it directly in VFP6 easier? :)
 
My main motivation is to make myself a slide show viewer for my camera pictures and I just want to explore all the possibilities.

Russ =)
 
AbashedGoat,

It is sometimes hard to get the exact swing of things in here, been there done that myself. But, you should start your own thread for this question. It is not the same question as this thread... what you are doing is called "thread hijacking", "thread jumping", or even "Off-Topic Posting". The danger in this is that your post will get Red Flagged most of the time and then end up deleted by management (which then makes you, and anyone who answered you, have to start all over again). If you do it often enough and ignore the helpful advice to start your own thread for things like this you can actually get banned from the forum. So, while your question is a good one, try starting your own thread in the "VFP - Web Related Issues"...which incidentally is where this thread should have been started in the first place given that it is dealing with IE/Webpage/Image.

Please know that I am not trying to lecture, just trying to help you avoid future trouble, have the best chance of getting a good response to your question, and save not only you, but other members time and effort that may be wasted when and if one of your questions/posts gets deleted for not following the general rules of TT.

boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top