Page 1 of 1

(Howto) get an image from internet and display it (and more)

Posted: 28 May 2006 20:40
by Gildas Menier
This project shows how to download a web page, parse it to extract the <img> tags (thanks to a code made by Mr Yasuhisa Matsumura and available in the examples of visual prolog). Then how to download a picture (given its URL) and make a gdi image from it and display it.

The project contains a very small subset of predicates to call wininet. This should work for CE and PE.

The code from Mr Yasuhisa Matsumara can be found there http://www.visual-prolog.com/vip6/Commu ... ToList.htm

regards

Gildas

- I try to keep my codes up to date there http://www.arsaniit.com, so feel free to tell me if it needs a fix or two.
- these dogs don't belongs to me. Thanks god (or sknahT dog)

Posted: 20 Aug 2011 10:18
by drspro2
I believe that the following modification should be made to make it possible to read longer url-strings

Code: Select all

% new         getURLContentAsBin(URL) = Res :-           IT   = vp_web::internetOpenws(),           FIT = vp_web::internetOpenUrlWs(IT,URL),           binres := binary::createAtomic(0),           sz := 0,           programControl::repeat,               Temp = binary::createAtomic(bufferSize),               Remain = vp_web::internetReadFile(FIT, Temp, bufferSize),                     sz:=sz+Remain,                     Temp2 = binary::reSize(Temp,Remain),                     binres := binary::concat(binres, Temp2),          Remain = 0,          vp_web::internetClosehandle(FIT),          vp_web::internetClosehandle(IT),          Res = binary::reSize(binres,sz),     !.     /* Old       getURLContentAsBin(URL) = Res :-           IT   = vp_web::internetOpenws(),           FIT = vp_web::internetOpenUrlWs(IT,URL),           binres := binary::create(0),           sz := 0,           Temp = binary::create(bufferSize),           programControl::repeat,               Remain = vp_web::internetReadFile(FIT, Temp, bufferSize),               sz:=sz+Remain,               binres := binary::concat(binres, Temp),           Remain = 0,          vp_web::internetClosehandle(FIT),          vp_web::internetClosehandle(IT),          Res = binary::resize(binres,sz),     !.%    */

Howto get an image from internet and display it and more

Posted: 14 May 2019 2:38
by byronGaf
ListSubItemsIndex has a ReportIcon-Property, but all examples i found use an ImageList, so no idea if it works with an image from a path