PictureBox load remote image?

Started by honkinberry, March 09, 2011, 10:05:16 AM

Previous topic - Next topic

honkinberry

I'd like my PictureBox control to display jpg images that are either saved locally, or referenced to an http location.  I've experimented with having a WebBrowser and PictureBox control on the form, and toggling between them, but the PictureBox control is just simply superior for displaying images (it scales the image automatically and fluidly through dialog resize, it doesn't have scroll bars, etc).
So is there a trick to getting it to load an http image, or perhaps is this something that can be added to the wishlist?
Many thanks for any info.

--J

Fred Tomke

Hi, honkinberry, hm, I'd focus the picturebox. I may be wrong, but wasn't there any ActiveX code to downlaod a file? You only have to do the same as the Web-Browsers do: download the file (internally, of course) and display it. The only thing you need is the downloading code.

Regards,
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

BazzaCAD

honkinberry,
What version are you using?
The "LoadPictureFile" works fine for me in the latest build 6.0.2.1

Code (autolisp) Select
(dcl_PictureBox_LoadPictureFile mytest_Form1_PictureBox1 "D:\\pic1.jpg" T)

I've also used the HTML control to show images without scroll bars. I write the HTML file on the fly:

<html> <head><style type="text/css">Html, body {Overflow:auto;}</style></head><body><div style="position:absolute; left:0; top:0;"><img src="http://www.somesite.com/somepic.jpg" border="0"></div></body></html>


I'm not sure why I used Overflow:auto instead of Overflow:hidden, but try them both...
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

honkinberry

Sorry for the delay in replying, I was out of the country.

In the example you have, you are loading from the D:\ drive.  That works, yes.
I'd like to also load from an http location, which does not seem to work with the latest build.

--J

owenwengerd

Look at Barry's HTML control example; it is loading from an HTTP server.

honkinberry

Yes, but in OP, I indicated I would like to use a PictureBox, instead of an Http Control, as I find the picture scaling to be more controllable.
My ideal would be to use a PictureBox control for both local and remote content.
If I cannot open remote content with it, then I can download the jpg on the fly, but I'd like to avoid doing that, hence asking if I'm missing some trick to getting a PictureBox to load remote content.

--J

owenwengerd

If the remote content is on your own server, you could map it to a local file path via WebDAV or something, but otherwise I don't think there is any way to dynamically link a picturebox to a remote image file via HTTP.

Abigail111

I also want to know a tricks to load image.I often load image in a difficult way.I want to know is there any easy way to load image?Thanks

Fred Tomke

Hi, Abigail,

your link shows a way I also use: extract images from icons or create a thumbnail in a temporary file at  runtime to load them afterwards in OpenDCL.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]