Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
Konva: Load SVG from url

I found I have to use img-use to load image to a layer in konva. It work for jpg and png, but not for svg. What else I can do to have one layer with an SVG?

import useImage from "use-image";
  const [backgroundImage] = useImage(
    `https://ticket-t01.s3.eu-central-1.amazonaws.com/madach-2.svg` || ""
  );

Actually it loads the image bit it is very pixelated. Shall I save diffrently the SVG when re-exporting from Illustrator?

enter image description here

<Stage
  width={
    gridWidth ? (gridWidth >= 600 ? gridWidth : gridWidth) : 200
  }
  height={
    layout && gridWidth
      ? Math.round(gridWidth / layout.aspectRatio)
      : 200
  }
>
  <Layer>
    <Rect
      x={0}
      y={0}
      width={gridWidth || 200}
      height={
        layout && gridWidth
          ? Math.round(gridWidth / layout.aspectRatio)
          : 200
      }
      fillPatternImage={backgroundImage}
      fillPatternRepeat="no-repeat"
      fillPatternScale={{
        x: (gridWidth || 200) / (backgroundImage?.width || 200),
        y:
          (layout && gridWidth
            ? Math.round(gridWidth / layout.aspectRatio)
            : 200) / (backgroundImage?.height || 200),
      }}
    />
  </Layer>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda