我可以使用 j2me 应用程序截取手机屏幕截图吗?

发布于 2024-12-26 20:10:00 字数 136 浏览 2 评论 0原文

我正在尝试开发一款无线电话投影仪,其中我将使用连接电脑的投影仪在投影仪上显示手机屏幕。

我对如何捕获 j2me 中任何正在运行的应用程序的屏幕截图感到有点困惑。

你能帮忙吗?

只是想在 j2me 中捕获屏幕截图

I am trying to develop a wireless phone projector, wherein I will be showing phone screen on projector using a projector connected PC.

I am bit confused on how to capture screenshot of any running application in j2me.

Can you help?

Just want to capture screenshot in j2me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自由范儿 2025-01-02 20:10:00

我不太确定你想做什么,但如果你正在考虑一种方法让你的应用程序获取屏幕截图,那么我可以说你可以做到,但不能做到。为什么你做不到?假设您在创建屏幕时使用画布。我认为没有办法将画布转换为图像。画布仅限于在手机屏幕上绘制自身。但是,就像我之前所说的,您还可以创建应用程序屏幕的屏幕截图。您需要在 Canvas 上拥有一个 Image 对象。为什么是图像?这是因为Image对象可以转换为图像文件。图像文件将是您的屏幕截图。但是,当然,应该有一些东西可以动态地为画布上的图像对象创建图像源。

Image myScreen = Image.createImage(createScreen());

创建屏幕的方法:

InputStream createScreen(){
    //dynamically creates the source of the screen
}

您可以使用myScreen进行屏幕截图。这里的缺点是渲染速度相当慢。这是可能的,但我认为这有点难以实施。

I'm not really sure of what you wanted to do but if you are thinking of a way for your app to get a screenshot of its screen then what I can say is that you can and cannot do it. Why you cannot do it? Say your using a canvas in creating your screen. I think there isn't a way of converting the Canvas to an Image. The Canvas is limited to just drawing itself on the phone screen. But, like what I have said earlier, you can also create a screenshot of your app screen. What you need to have is an Image object over your Canvas. Why Image? It is because the Image object can be converted to an image file. And the image file will be your screenshot. But, of course, there should be something that dynamically creates the image source for the image object on the canvas.

Image myScreen = Image.createImage(createScreen());

A method that creates the screen:

InputStream createScreen(){
    //dynamically creates the source of the screen
}

You can have a screenshot using myScreen. The drawback here is that rendering is quite slow. This is possible but I think this is kind of difficult to implement.

后知后觉 2025-01-02 20:10:00

使用此代码片段,您可以对应用程序中的画布进行“屏幕截图”:

public Image getScreenShot() {
  Image screenshot = Image.createImage(getWidth(), getHeight());
  Graphics g = screenshot.getGraphics();
  paint(g);
  return Image.createImage(screenshot);
}    

getScreenShot() 添加到您想要“屏幕截图”的任何画布。然后您可以获得它的 RGB 并转换为byte[] 并将其在网络上传递。
参考资料:
developer.nokia

With this snippet code you can take a "screenshot" of the Canvases in your app:

public Image getScreenShot() {
  Image screenshot = Image.createImage(getWidth(), getHeight());
  Graphics g = screenshot.getGraphics();
  paint(g);
  return Image.createImage(screenshot);
}    

Add getScreenShot() to any canvas that you want "screenshot" of it.Then you can get it's RGB and convert to byte[] and pass it on the network.
References:
developer.nokia

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文