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












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Image from URL
Image from URL [message #27445] Sun, 18 July 2010 09:46 Go to next message
WhiteMike is currently offline  WhiteMike
Messages: 2
Registered: July 2010
Junior Member
I have a very short question:
How it's possible in U++ to get an Image from URL?

Thanks a lot for replying.
Re: Image from URL [message #27452 is a reply to message #27445] Sun, 18 July 2010 19:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12126
Registered: November 2005
Ultimate Member
#include <CtrlLib/CtrlLib.h>
#include <Web/Web.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(HttpClientGet("http://www.ultimatepp.org/1i.png"));
	}
};

GUI_APP_MAIN
{
	MyApp().Run();
}


(you will need to add Web package).

(Added as reference/WebImage).

Mirek
Re: Image from URL [message #27453 is a reply to message #27452] Sun, 18 July 2010 19:43 Go to previous message
WhiteMike is currently offline  WhiteMike
Messages: 2
Registered: July 2010
Junior Member
Looks very good.
Thank you!
Previous Topic: Some simple way to convert Image into 1bpp raw data in memory?
Next Topic: Event on DrawDrawing
Goto Forum:
  


Current Time: Sat Dec 14 20:25:38 CET 2019

Total time taken to generate the page: 0.00987 seconds