Home » Community » Newbie corner » WebImage example not working (Examples)
Re: WebImage example not working [message #56070 is a reply to message #56033] |
Tue, 19 January 2021 23:22   |
 |
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
Hello Dschoni,
Glad to help ! you don't need to add #include <Core/SSL/SLL.h> . The only thing you need to do is adding the package to your project :
Here is my project without Core/SSL package :

At this point, my following code :
#include <Core/Core.h>
#include <Draw/Draw.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
Image img = StreamRaster::LoadStringAny(HttpRequest("https://www.ultimatepp.org/0i.png").Execute());
}
Will compile and work but my Img wont be loaded because HttpRequest is not performing all SSL requieremet. That's why Core/SSL have been created.
By right clicking to my main package (testimg in my screenshot) and select "Add package to testimg"

I'm able to add Core/SSL to my project :

Since Core/SSL is part of Core (it can be see as kind of plugin) I'm not obligated to include it in my project.
By now, my exemple above will work and download the image.
PS: Also, if you plan on doing more stuff about loading image, or play with several image type, be sure to include all format you need (package plugin/png, plugin/bmp, plugin/gif...) otherwise, the StreamRaster::LoadStringAny(...) wont be able to convert your image data into standard U++ Image
[Updated on: Wed, 20 January 2021 09:20] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Aug 24 19:23:43 CEST 2025
Total time taken to generate the page: 0.05024 seconds
|