Esc

draw_image

procedureextensionexperimentalsince 0.36.1Source
  • macOS: draw_image works on macOS
  • Linux: draw_image works on Linux
  • Windows: draw_image works on Windows
  • Wasm: draw_image is not available on Wasm

Draw borrowed, straight-alpha RGBA8 pixels stretched into rect. Keep the pixels alive until presentation or readback finishes. Clipping and logical display scaling apply as for rectangles.

Signature

draw_image :: (ui: *UI_State, rect: Rect, image: Image)
Example
Raster :: #import "Extensions/Image";
image := Raster.make_image(2, 2, .RGBA8);
defer Raster.deinit(*image);
ui := headless();
defer free_ui(*ui);
draw_image(*ui, .{ 0, 0, 20, 20 }, image);

See also