fromTvgFile
Render tvg_bytes at height into a Texture. Name is for debugging.
Only valid between Window.beginand Window.end.
Parameters
- name:[]const u8
- []const u8
- tvg_bytes:[]const u8
- []const u8
- height:u32
- u32
- icon_opts:IconRenderOptions
- IconRenderOptions
Source
Implementation
pub fn fromTvgFile(name: []const u8, tvg_bytes: []const u8, height: u32, icon_opts: IconRenderOptions) (TextureError || TvgError)!Texture {
const cw = dvui.currentWindow();
const img = Color.PMAImage.fromTvgFile(name, cw.lifo(), cw.arena(), tvg_bytes, height, icon_opts) catch return TvgError.tvgError;
defer cw.lifo().free(img.pma);
return try create(img.pma, .{ .width = img.width, .height = img.height });
}