Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

WebImage

 

Using HttpRequest to obtain image from web, and displaying it

 

 

main.cpp

 

#include <CtrlLib/CtrlLib.h>

 

using namespace Upp;

 

struct MyApp : TopWindow {

    Image img;

    

    virtual void Paint(Draw& w) {

        w.DrawRect(GetSize(), Gray());

        w.DrawImage(0, 0, img);

    }

    

    MyApp() {

        img = StreamRaster::LoadStringAny(HttpRequest("http://www.ultimatepp.org/1i.png").Execute());

    }

};

 

GUI_APP_MAIN

{

    MyApp().Run();

}

 

 

 

 

Do you want to contribute?