How to draw images without them being cached #949
-
Hey! I have been rendering images and I think they have been leaking memory because they get cached. Here is some code of how I do it: let pic = Image::from_encoded(unsafe { Data::new_bytes(bytes) });
if let Some(pic) = pic {
let mut paint = Paint::default();
paint.set_anti_alias(true);
canvas.draw_image_nine(
pic,
IRect::new(0, 0, 0, 0),
Rect::new(area.min_x(), area.min_y(), area.max_x(), area.max_y()),
FilterMode::Last,
Some(&paint),
);
} I have seen some mentions of a |
Beta Was this translation helpful? Give feedback.
Answered by
pragmatrix
Mar 19, 2024
Replies: 1 comment 6 replies
-
hey @tronical, sorry for pinging but I thought you might have not seen this |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Marc, I am not sure, but may be the images get cached in the resource cache, the
skia_safe::graphics::resource_cache*
functions may help, and there you can set limits, too.