Re: Can I load a picture form an URL into a Picturebox?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



If you're using the webbrowser the page or item displayed is eventually go
to be stored in the IE cache. The user may not be able to view source, but
the file remains available unless you're also taking steps to nuke the
cache. And not nuke the entire cache, as that would constitute a
poorly-designed app.

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
----------------------------------------------------------------------------
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
----------------------------------------------------------------------------



"Alan Silver" <alan-silver@xxxxxxxxxxxx> wrote in message
news:FNmq2yBR0wiCFwjZ@xxxxxxxxxxxxxxxxxxxxxx
: >> If anyone is interested, I found an answer shortly after posting. I
: >> don't know if this will work with all browsers, but given that the
: >> control is based on IE, that doesn't matter.
:
: I was contemplating this again last night and realised that I actually
: disagree with pretty much all of your arguments against using a web
: browser control. That's not to say that you are wrong, just that some of
: the issues you raise are IMHO not necessarily as serious as you make
: out, and some of them are not important in my particular application.
:
: I only make these comments out of interest as I would like to hear your
: views. I'm certainly not trying to flame you or start an argument!!
:
: >IMO this is a very nasty way of accomplishing it since you have the whole
of
: >IE (and all it's associated bugs/back-doors etc) just sitting on your
form -
:
: Well, other than the specific issues you mention below, I'm not sure
: what the problem is here. I am telling the control what to display, so I
: know it will display fine. This is even easier than designing for the
: web as I *know* I'm only dealing with IE. I can account for any bugs or
: back doors. Also, the HTML I am displaying is so simply that even IE
: can't do too much wrong with it <g>
:
: >users can 'view source' on it
:
: Only if they know it's a web browser control, which in my app they
: probably wouldn't as it looks like a Picturebox.
:
: And even if they could see the source, so what? The situation I
: described involved using the control to display an image directly from a
: web site. Using the solution I offered, the sum total of source that
: they would see is ...
:
: <html>
: <head></head>
: <body topmargin="0" leftmargin="0" scroll="no">
: <img src="http://www.whatever.com/fred.jpg";>
: </body>
: </html>
:
: Who cares if they see it? I should point out that in my instance, the
: image being shown is one from the web site owned by the person running
: the application, so seeing the source URL of the image isn't an issue.
: Furthermore, the HTML shown above doesn't leave any space around the
: image (the control is sized exactly to the image), so right-clicking
: would only give the context menu for an image, which does not include
: "view source".
:
: I have used web browser controls loads of times as an easy way of
: generating reports. I don't see the problem if the user wants to look at
: the source. Let 'em, there's nothing secret there.
:
: Finally on this point, it's pretty easy to capture events from the
: control's Document object, so you can simply not have the context menu
: show at all. That way they couldn't see the source if they wanted to.
: Equally you can capture the keyboard events, so clicking on the control
: and doing
: Ctrl-N wouldn't open up the "page" in a new window.
:
: > or even drag and drop links into it - eugh..
:
: Again, what's the problem? It's no worse than opening IE and dragging a
: link onto that. If they really want to replace the image (which is there
: for their benefit) with something else, let them.
:
: Anyway, disabling drag and drop in the control is very easy if this
: really were an issue.
:
: >Personally I would recommend looking at some simple Inet calls to
retrieve
: >the picture data and load it into the picture box from there, you loose
the
: >bloat of IE
:
: What bloat? IE is on the machine anyway, adding the control to the app
: doesn't make the EXE bigger (that I've ever seen, and I've used them
: loads of times), nor does it use any noticeable extra memory. Where's
: the bloat?
:
: > and all the security/interface issues
:
: Which security issues? Remember, they are running this on their own
: machine. Anything they can do in the browser control, they could do in a
: normal IE window. It's not like they can write a web page containing
: script that can communicate with the application using the control. I
: don't see any security issues.
:
: > not to mention having more
: >control over the image itself. IE will even be really nice (*groan*) on
: >some machines and happily re-size the image for you automatically to fit
: >within the frame,
:
: AFAIK that's only when you display the image directly in the browser. If
: you display it in a web page inside an <img> tag, IE doesn't rescale it.
:
: > unfortunately their scaling is terrible and will make
: >small text almost unreadable very quickly.
:
: That's true enough, but not relevant if you show the image via HTML as I
: explained.
:
: > And hey, what about those users
: >who have their IE set to zoom the page or have images turned off?
:
: Ten years ago I would have agreed with you. Today, I'm not so sure. Even
: dial-up users rarely turn off images.
:
: Anyway, if they turned them off, then they accept the consequences of
: doing so. As I pointed out, this image is displayed for their benefit.
: If they don't want to see it, I'm not going to force them.
:
: > You'll
: >get all that to deal with too, damned user settings.. ;)
:
: If I were using the control for more complex stuff, then there's a
: possibility I might agree. Given that's it's only displaying a very
: simple piece of HTML that shows an image, I can't see that any user
: settings (other than the highly unlikely one of them switching off
: images) are going to affect it.
:
: >Embedding the web-browser works in some situations, but for simply
: >displaying an image it's IMO heavy handed and prone to all kinds of
: >problems, it's your app though so do what you wish.
:
: As I said at the start, I'm not trying to start a fight, I'm genuinely
: interested in hearing your comments. After some contemplation, I really
: can't see that any of your objections are going to be a problem, and
: AFAIK (having used the control a lot in applications), it doesn't add
: any weight to the app.
:
: That doesn't mean to say I'm going to ignore your comments though!! I am
: still thinking seriously about downloading to a file and using a
: Picturebox. I just like to work through all the issues on both sides and
: establish a clear picture of the pros and cons of everything. That helps
: make a better informed decision both this time and in the future.
:
: >FWIW,
:
: All sensible comments are worth something. Even if I end up using the
: browser, the discussion opens up new ideas and gives insights that help
: us make more informed decisions.
:
: Thanks for the reply
:
: --
: Alan Silver
: (anything added below this line is nothing to do with me)

.



Relevant Pages

  • RE: Doubt in SOAP with DIME attachments!
    ... When you consider that display of a particular file types requires the ... appropriate display target (e.g. a picture box for a picture, ... Then to launch the right viewer, ... If you have a control that is compatible with the data you received in the ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: BMP image in forms
    ... I'm afraid that changing directions on how I display pictures is going to ... Control Access", etc.). ... Sylvain Lafontaine, ing. ... You can then use the Picture control to display ...
    (microsoft.public.access.forms)
  • Re: Validating ComboBox Entries
    ... To prevent a user from entering any data, it can't be in the rowsource. ... still need to see it in the employees historical entries. ... the project name is displayed in the Combo control. ... I would have to display a Message Box or something similar to ...
    (microsoft.public.access.formscoding)
  • Re: Runtime problem: Picture control useless without "Converters & Filters" from Offic
    ... > graphics filters. ... In that application 'picture' control is ... to having this orginal 'picture' control get 'hacked' ... >>nor BMPs to display the images. ...
    (microsoft.public.access.devtoolkits)
  • Displaying images in continuous forms
    ... I have been researching for several hours on the best way to display ... ActiveX image control - so far, I have found a few ActiveX image ... datalist component that would simply display the picture and a few ...
    (comp.databases.ms-access)