简体   繁体   English

java.awt —当Java将图像输出到监视器(屏幕)时,输出到监视器卡的文件在哪里?

[英]java.awt — when java outputs an image to my monitor (screen), where is the file that is output to the monitor card?

Suppose that I am drawing a set of images using java graphics objects. 假设我正在使用Java图形对象绘制一组图像。 Suppose that I java is outputting these images to my monitor. 假设我将这些图像输出到监视器。 Where is the file or files that are sent to the monitor card (the graphical representation files). 发送到监视卡的一个或多个文件在哪里(图形表示文件)。 How can I take this file and save it to disk, or how can I take this file and write it to an array, or how can I take these files and combine the results of their output (to the monitor) into a single file for saving? 如何获取此文件并将其保存到磁盘,或者如何获取此文件并将其写入阵列,或者如何获取这些文件并将其输出结果(到监视器)合并为一个文件保存? I don't want to use a screen shot feature, I want to be able to redirect (xor capture also) the output to the monitor to some sort of byte-stream. 我不想使用屏幕截图功能,我希望能够将输出重定向到监视器(也可以捕获)到某种字节流。 I note that monitors are much better than semaphores, when you are talking about display capabilities; 我注意到在谈论显示功能时,监视器比信号量要好得多。 I don't need a counter example. 我不需要反例。

I might not be asking the correct question. 我可能没有问正确的问题。 It might be that I want to capture the file while it is still in User Space, before it is put into 'Device Space'. 可能是我想在文件仍位于用户空间中时捕获它,然后再将其放入“设备空间”中。 I would like to try and capture the byte stream so that I can convert it to MPEG-4 format. 我想尝试捕获字节流,以便可以将其转换为MPEG-4格式。 I either need a streaming output from the MPEG-4 converter, coming from the streaming input, or else, I need to take static images at discrete times and convert the images. 我要么需要来自MPEG-4转换器的流输出,要么来自流输入,否则,我需要在离散时间拍摄静态图像并对图像进行转换。

What format will the output from User Space be in? 用户空间的输出将采用哪种格式? What format will the Device Space output be in? 设备空间输出将采用哪种格式? Try to keep speculation to a minimum. 尽量减少猜测。

http://docs.oracle.com/javame/config/cdc/opt-pkgs/api/jsr927/index.html http://docs.oracle.com/javame/config/cdc/opt-pkgs/api/jsr927/index.html

I guess that Java has made a means of displaying AWT objects on a television screen. 我猜想Java已经实现了在电视屏幕上显示AWT对象的方法。 (Java TV). (Java TV)。

In Java both the "user" and "device" data are handled via images and rasters. 在Java中,“用户”和“设备”数据都是通过图像和栅格处理的。 If you dig a little deeper in the source files you'll see that the SunGraphics2D , which is used for drawing behind the scenes, uses pipes (SunGraphics2D lines 154-159) which again uses Blits to transfer the graphics data onto an image (or a 2-dimensional screen). 如果您对源文件进行更深入的研究,您会发现用于在后台绘图的SunGraphics2D使用管道 (SunGraphics2D线154-159),该管道再次使用Blits将图形数据传输到图像上(或二维屏幕)。 And both the graphics and pipes are programmed to do only this. 图形和管道均已编程为仅执行此操作。 So it is as MadProgrammer said - you need to render the graphics on an image to extract it. 就像MadProgrammer所说的那样-您需要在图像上渲染图形以将其提取。 And this is basically as low-level as you get before the native implementations kick in. 这基本上与您在本机实现开始之前所获得的一样低。

This can be done in parallel with the normal paint-mechanisms running in Java. 这可以与Java中运行的常规绘制机制并行完成。 the thread MadProgrammer mentioned gives excellent examples really. MadProgrammer提到线程确实提供了出色的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM