Skip to content

How to properly draw offscreen images? #2536

Answered by NikitaDudin
Glazzes asked this question in Q&A
Discussion options

You must be logged in to vote
  const size = 100;
  const offscreen = Skia.Surface.MakeOffscreen(size, size)!;
  const canvas = offscreen?.getCanvas();
  const paint = Skia.Paint();
  canvas.drawImageRectOptions(
    image,
    rect(0, 0, image.width(), image.height()),
    rect(0, 0, size, size),
    FilterMode.Linear,
    MipmapMode.Linear,
    paint,
  );
  offscreen.flush();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Glazzes
Comment options

Answer selected by Glazzes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants