Re: Can I load a picture form an URL into a Picturebox?
- From: "Lance" <chuckyboy81070-at-onehotpotatoimeanhotmail.com>
- Date: Wed, 18 May 2005 09:47:51 -0500
i think this is the best way, beacause of the asynchronicity. that's how i
download data into my progams all the time now.
"J French" <erewhon@xxxxxxxxxx> wrote in message
news:428b1f5d.23827624@xxxxxxxxxxxxxxxxxxx
> On Wed, 18 May 2005 10:38:25 +0100, Alan Silver
> <alan-silver@xxxxxxxxxxxx> wrote:
>
>>>> 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.
>
> <snip>
>
> Personally I think that you are using an elephant gun as a hammer to
> crack a hazelnut
>
> However - each to their own.
>
> Here is another method that I rather suspect you've not seen before.
>
> Create a new project
> Add a UserControl
>
> Paste this into the UserControl :-
>
> --------------- Start of UserControl ----------------
>
> Option Explicit
>
> ' J French 18-5-05 UserControl Async Read an Image
>
> 'Private Const Url$ = "c:\windows\setup.bmp"
>
> Private Const Url$ = "http://www.iss.u-net.com/isslogo.gif"
>
> Public Sub DownLoad()
> Call UserControl.AsyncRead(Url$, vbAsyncTypePicture, "SomeTag")
> End Sub
>
>
> Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
> UserControl.Picture = AsyncProp.Value
> End Sub
>
> --------------- End of UserControl ----------------
>
> Now close the UserControl using Ctl F4
> - add one largish instance to your Form
> - add one Button
>
> Paste in this :-
>
> Private Sub Command1_Click()
> UserControl11.DownLoad
> End Sub
>
> ---------------------------------------------------------------
>
> Now you have something that will download an Image from the Net and
> display itself on its own window.
>
> I'm not sure what it will do if offline as I'm on ADSL
> - probably attempt to dial up
.
- Follow-Ups:
- Re: Can I load a picture form an URL into a Picturebox?
- From: Alan Silver
- Re: Can I load a picture form an URL into a Picturebox?
- References:
- Can I load a picture form an URL into a Picturebox?
- From: Alan Silver
- Re: Can I load a picture form an URL into a Picturebox?
- From: Mike D Sutton
- Re: Can I load a picture form an URL into a Picturebox?
- From: Alan Silver
- Re: Can I load a picture form an URL into a Picturebox?
- From: J French
- Can I load a picture form an URL into a Picturebox?
- Prev by Date: Re: Same code, different outcomes
- Next by Date: OLEDragDrop event for whole form
- Previous by thread: Re: Can I load a picture form an URL into a Picturebox?
- Next by thread: Re: Can I load a picture form an URL into a Picturebox?
- Index(es):