TGUI Forum

General Category => General Discussion => Topic started by: ingar on 15 May 2019, 22:08:19

Title: Updating existing Picture widget
Post by: ingar on 15 May 2019, 22:08:19
Hi again,

I have this scenario:

I receive a .jpg file image on TCP/IP from an external server.
So I have a byte buffer (with a given length) containing the jpg file.

So how do I update an existing Picture widget from this buffer?

I know how to create a NEW Picture widget from a buffer, using an sf::Texture in the constructor,
but isn't it a bit overkill to create a new one every time? I saw that a function tgui::Picture::setTexture was available
in version 0.78, but this function has been removed in the latest version (0.85).

Ingar
Title: Re: Updating existing Picture widget
Post by: texus on 15 May 2019, 22:09:56
The texture became part of the renderer in 0.8, so you can use picture->getRenderer()->setTexture(...)