Highlighted
Absent Member.
Absent Member.
982 views

[archive] Problem with web-browser control

[Migrated content. Thread originally posted on 30 January 2007]

I have an application in which I want to allow the user to access jpg files in a specified folder. I am trying to use the web-browser control so he sees the same viewer as if he was in windows explorer. The results are not the same. Please see the attachment which contains screen shots and sample code. Any suggestions would be appreciated.
0 Likes
9 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

If you create a straight HTML page and include your jpeg image in that page you would see the same results as you do with the web browser control. The Windows image and fax viewer is a different Windows application that resizes the image for easier viewing. You may want to save your jpeg as thumbnails and see if the image resolves better when loading into the web browser.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

Accompany your images with a corresponding html file, then display the html file instead of the image in the browser.
You should create te html file dynamically, all that need to be in there is:



The three parameters; src, width and height you can set to your desire. Typically you will try to match width and height with the size you designate the web control. src should be given the absolute path to the image file.

Doing this, the picture will be scaled to fit to your web control, provided the dimensions you provide are fitting.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

I don't want to hijack the thread, but is there anyway to completely get rid of the vertical scroll bar on the web-browser control?

I see the horizontal only displays when the picture is too wide to display fully, but the vertical one is always there no matter what, just 'greyed out'.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

I am not familiar with the
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

Ignore my previous post, I figured it out and your solution seems to be working great, thanks again,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

One more question. Using your solution (creating the html file with the single line) works, but only displays the jpg file. I would like for the Windows and Fax viewer to be displayed with the picture so my user could use the tool bar that comes with it for emailing, etc. Is that possible?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

If the Fax viewer is a generally available ActiveX component, I see no problem in this, unfortunately I have no expirence with this component, so I cannot give you an example right here and now.

May be someone else has already been down that path.

However, if the topic is about emailing the image, you do not need to use a fax component for that purpose. If you have an smtp server available, you can hook up with this.

Courtesy from Mr. Peter Doerrenbacher, Kiss personal Gmbh there is on this forum an example in plain COBOL that show how to send an email via smtp with attachment. You might want to look at that one.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

My understanding from the AcuCorp webinar that the web browser control when launching a file would use the same program as Windows explorer does when you click on the file with the same suffix, Word, Acrobat, etc. This does not seem to hold true with the jpg files as Explorer uses whatever program you have assigned through windows, in this case, the Windows picture and fax viewer. If web-browser is doing this I'am not sure, because the tool bar from the viewer does not appear.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problem with web-browser control

First, the web browser encapsulates the WebBrowser2 COM interface to Internet Explorer, not Windows Explorer.
To my knowledge, the preview facility of Windows Explorer is limited to just that, Windows explorer, and not Internet Explorer. The latter which use a different approach for associations.
Where Windows explorer will rely on associations to the extension of a file will Internet explorer depend on the MIME tag (as above is IMG) to identify how to show a file.
So, I suggest you try to figure out the MIME tag (if any) for the fax viewer, a good start is to look here in the windows registry (careful with modifications though) HKEY_CLASSES_ROOT\MIME\Database\Content Type
As for the toolbar, a toolbar is usually application specific, as is in this case. If you want a toolbar, you have to provide and populate this yourself.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.