fromImageFile
Parameters
- name:[]const u8
- []const u8
- image_bytes:[]const u8
- []const u8
- interpolation:TextureInterpolation
- TextureInterpolation
Source
Implementation
pub fn fromImageFile(name: []const u8, image_bytes: []const u8, interpolation: TextureInterpolation) (TextureError || StbImageError)!Texture {
const img = Color.PMAImage.fromImageFile(name, dvui.currentWindow().arena(), image_bytes) catch return StbImageError.stbImageError;
defer dvui.currentWindow().arena().free(img.pma);
return try create(img.pma, .{ .width = img.width, .height = img.height, .interpolation = interpolation });
}