q5play
    Preparing search index...

    Function inset

    • 🌆 Displays a region of the image on another region of the image. Can be used to create a detail inset, aka a magnifying glass effect.

      Parameters

      • sx: number

        x-coordinate of the source region

      • sy: number

        y-coordinate of the source region

      • sw: number

        width of the source region

      • sh: number

        height of the source region

      • dx: number

        x-coordinate of the destination region

      • dy: number

        y-coordinate of the destination region

      • dw: number

        width of the destination region

      • dh: number

        height of the destination region

      Returns void

      await Canvas(200);

      let logo = await load('/q5js_logo.avif');

      logo.inset(256, 256, 512, 512, 0, 0, 256, 256);
      image(logo, -100, -100, 200, 200);