我目前正在从事一个由患者数据库组成的医疗项目。每次将患者添加到记录中并且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) 您可能注意到我问了很多与我的项目相关的问题,所以提前感谢您的所有支持。
我的项目包括围绕太阳旋转的地球和月球。(它们并不是专门围绕太阳旋转,而是更多地围绕太阳所在的 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) 我目前正在开发一个用于加载卡片列表的页面的控制面板。
我有两条不同的 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)