小编zad*_*ers的帖子

如何使用ZXing [ASP.Net WebForm]直接从移动相机读取QR码

我目前正在从事一个由患者数据库组成的医疗项目。每次将患者添加到记录中并且QR码包含患者的ID时,我都会使用zxing生成QR码。

生成代码如下

 //GENERATE QRCODE
        private void GenerateCode(string patientIdString)
        {           

            var writer = new BarcodeWriter();
            writer.Format = BarcodeFormat.QR_CODE;
            var result = writer.Write(patientIdString);
            string path = Server.MapPath("~/images/" + patientIdString + ".jpg");
            var barcodeBitmap = new Bitmap(result);

            using (MemoryStream memory = new MemoryStream())
            {
                using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.ReadWrite))
                {
                    barcodeBitmap.Save(memory, ImageFormat.Jpeg);
                    byte[] bytes = memory.ToArray();
                    fs.Write(bytes, 0, bytes.Length);
                }
            }
            patientQRCode.Visible = true;
            patientQRCode.ImageUrl = "~/images/"+ patientIdString + ".jpg";
        }
Run Code Online (Sandbox Code Playgroud)

然后在AddPatient功能上调用此方法,该功能运行良好。

在我的“扫描”页面上,我有两个功能,或者是用户单击在dataTable上查看的患者ID(将其重定向到查看患者页面),或者是用户具有使用其移动摄像头的功能。

读取QR码并将其翻译的代码如下

//READ CODE FROM QR IMAGE
        private …
Run Code Online (Sandbox Code Playgroud)

c# asp.net zxing

7
推荐指数
1
解决办法
967
查看次数

如何让对象在垂直轴上并围绕另一个对象旋转 Three.js

您可能注意到我问了很多与我的项目相关的问题,所以提前感谢您的所有支持。

我的项目包括围绕太阳旋转的地球和月球。(它们并不是专门围绕太阳旋转,而是更多地围绕太阳所在的 0,0 轴旋转)。

我最初创建了几何图形,然后将它们添加到场景中,然后添加到轨道组中,如下所示

var orbitGroup = new THREE.Object3D();
                scene.add(orbitGroup); 

            scene.add(planetEarth);
            orbitGroup.add(planetEarth);
            scene.add(planetMoon);
            orbitGroup.add(planetMoon);
Run Code Online (Sandbox Code Playgroud)

然后我在渲染函数中声明旋转,如下所示

                   planetEarth.add( planetMoon );
                planetEarth.add(rocketGroup);

            // call the render function
            var angle = 0;
            render();

            function render() {
                stats.update();

                 // rotate the orbit group
                angle += 0.002;                    
                angle += 0.002 * controls.EarthRotationSpeed;
                planetEarth.rotation.y += controls.EarthRotationSpeed;                    
                planetMoon.rotation.y += controls.MoonRotationSpeed;                    
                angle+= 0.01 * controls.SunRotationSpeed;
                planetSun.rotation.y += controls.SunRotationSpeed;        

                 // rotate the orbit group
                angle += 0.02;
                orbitGroup.rotation.y = -angle / 10;


                littleOrbitGroup.rotation.x = -angle;


                // render using requestAnimationFrame …
Run Code Online (Sandbox Code Playgroud)

javascript three.js

2
推荐指数
1
解决办法
1460
查看次数

类型 '() => Promise<AxiosResponse<any>>' 不能用作索引类型 [ReactJs]

我目前正在开发一个用于加载卡片列表的页面的控制面板。

我有两条不同的 API 路线,如下所示:

const apiVideoUrl = "http://localhost:3000/videos/";
const apiManualUrl = "http://localhost:3000/manuals/";
Run Code Online (Sandbox Code Playgroud)

它们都返回显示为卡片的数据集,并且都包含 Id、Title、URL 和 ThumbnailUrl。我已经成功地单独加载视频或手册,但我似乎无法让它们一起加载。

我的 componentDidMount() 如下,这是错误产生的地方:

async componentDidMount() {
    const apiVideoUrl = "http://localhost:3000/videos/";
    const apiManualUrl = "http://localhost:3000/manuals/";

    const getVideos = async () => {
      return await axios.get(apiVideoUrl);
    };

    const getManuals = async () => {
      return await axios.get(apiManualUrl);
    };

    try {
      const [videos, manuals] = await Promise.all[(getVideos, getManuals)];

      // render to state setState({ prop: ? })
    } catch (error) {
      this.setState({ error });
    }
  }
Run Code Online (Sandbox Code Playgroud)

错误:

Type …
Run Code Online (Sandbox Code Playgroud)

javascript typescript reactjs

2
推荐指数
1
解决办法
5622
查看次数

标签 统计

javascript ×2

asp.net ×1

c# ×1

reactjs ×1

three.js ×1

typescript ×1

zxing ×1