首页 > 解决方案 > 如何使用 React js 将 Base64 字符串的图像转换为 blob?

问题描述

我正在使用 react-webcam 来捕获图片。我在 Base 64 中获取了捕获的图像。我想将其转换为 Blob

  capture = () => {

    const imageSrc = this.webcam.getScreenshot();
    Blob imageFile = someFunction(imageSrc) // want this code
    this.setState({
      imgsource: imageFile 
    });
  };

标签: javaspringreactjsspring-boot

解决方案


有很多方法可以解决这个问题。您可以查看以下解决方案:


推荐阅读