api icon indicating copy to clipboard operation
api copied to clipboard

New UIImage kind of object to cache offscreen images/textures

Open dacap opened this issue 2 years ago • 0 comments

We should be able to create an UIImage() from an Image (and maybe from scratch or other objects), and getting a GraphicsContext from it so we can paint on it as an offscreen Canvas object. The UIImage should be able to be the fastest representation to paint an image on the screen.

E.g.

local img = UIImage(app.activeImage)
Dialog():canvas{ ...
  onpaint=function(ev)
    local ctx = ev.context
    ctx:drawImage(img, 0, 0)
 end
}

dacap avatar Dec 16 '22 13:12 dacap