d47081
(D47081)
November 22, 2024, 12:03pm
1
Since: 4.12 Picture::new_for_pixbuf marked as deprecated, but not sure I understand how to replace it with Picture::new_for_paintable .
I’m dependent of Pixbuf, because reading the image from stream by Pixbuf::new_from_stream_async to memory, not as the tmp file on disk.
ebassi
(Emmanuele Bassi)
November 22, 2024, 12:27pm
2
Accumulate the stream contents inside a GBytes
and then use GdkMemoryTextureBuilder
to create a GdkTexture
, which implements the GdkPaintable
interface.
1 Like
d47081
(D47081)
November 22, 2024, 12:41pm
3
Thanks for a tip,
just implemented by following way in Rust:
Pixbuf::from_stream_async(
&memory_input_stream,
Some(&cancellable),
move |result| {
match result {
Ok(buffer) => {
Picture::for_paintable(
&Texture::for_pixbuf(&buffer)
);
Some related solution
system
(system)
Closed
December 22, 2024, 12:42pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.