作者:手机用户2502896757 | 来源:互联网 | 2023-08-31 21:29
ImtryingtocreateanAppletthatwillcaptureimagesfrommyWebcam.我正在尝试创建一个可以从我的网络摄像头捕获图像的App
I'm trying to create an Applet that will capture images from my Webcam.
我正在尝试创建一个可以从我的网络摄像头捕获图像的Applet。
I saw an sample in this thread but the import
s don't work in my class. They weren't recognized.
我在这个帖子中看到了一个示例,但导入在我的课程中不起作用。他们没有被承认。
I'm a newbie with Java, so, what i'm doing wrong ?
我是Java的新手,所以,我做错了什么?
2 个解决方案
0
In Webcam Capture project source code you can find webcam applet example and the working demo available here. This example does not require any additional JARs since it's shaded while the build. Shading is a process which packs all classes, from all dependent JARs, together, in only one file, referred then as shaded JAR. If you share all JARs you don;t have to build classpath since all imports are packed together.
在Webcam Capture项目源代码中,您可以找到网络摄像头applet示例和此处提供的工作演示。此示例不需要任何其他JAR,因为它在构建时被着色。着色是一个进程,它将所有依赖JAR的类打包在一起,只有一个文件,然后称为着色JAR。如果您共享所有JAR,则必须构建类路径,因为所有导入都打包在一起。
From the code perspective there is no difference from using webcam API provided within Webcam Capture project in JFrame
or JApplet
. It contains WebcamPanel
class which can be easily used to display image from camera in real time. For more details please check other examples.
从代码的角度来看,与使用JFrame或JApplet中的Webcam Capture项目中提供的网络摄像头API没有区别。它包含WebcamPanel类,可以很容易地实时显示来自摄像机的图像。有关详细信息,请查看其他示例。
The one important think you have to do, is to sigh your applet. This is required operation if you like to access host hardware. Without signing you would have to specify set of appropriate permissions, but I never did this, since, from my perspective JAR shading and signing with Maven a way easier.
你必须要做的一件重要的事情就是感叹你的小程序。如果您想访问主机硬件,这是必需的操作。如果没有签名,你就必须指定一组适当的权限,但我从来没有这样做,因为从我的角度来看,JAR着色和使用Maven签名更容易。