Updating existing Picture widget

  • 1 Replies
  • 150 Views
*

ingar

  • *
  • 26
    • View Profile
    • Label Printing Software & Solutions
Updating existing Picture widget
« 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

*

texus

  • *****
  • 1475
    • View Profile
    • Texus's Blog
Re: Updating existing Picture widget
« Reply #1 on: 15 May 2019, 22:09:56 »
The texture became part of the renderer in 0.8, so you can use picture->getRenderer()->setTexture(...)