I am trying to render just the bounding box with the C API
So far I can get the bounding box
resvg_rect bbox;
resvg_get_image_bbox(tree, &bbox)
and with that I have rect (width, height, x, y)
I can render the correct width and height
resvg_render(tree, transform, width, height, (char*)surface_data);
but I cant figure out how to render starting at the x and y for the bounding box
I see in the .h file line 456
transform A root SVG transform. Can be used to position SVG inside the pixmap.
through testing I found the transform.a = scale_x and the transform.d = scale_y
I am trying to render just the bounding box with the C API
So far I can get the bounding box resvg_rect bbox; resvg_get_image_bbox(tree, &bbox)
and with that I have rect (width, height, x, y) I can render the correct width and height resvg_render(tree, transform, width, height, (char*)surface_data); but I cant figure out how to render starting at the x and y for the bounding box
I see in the .h file line 456 transform A root SVG transform. Can be used to position SVG inside the
pixmap
. through testing I found the transform.a = scale_x and the transform.d = scale_yThis page looks to show the transform documentation https://docs.rs/tiny-skia-path/0.11.4/tiny_skia_path/struct.Transform.html but I havent figured out what kx ky tx ty mean
Can someone help me figure out transform or tell me im doing it wrong lol Thank you