在perl& Win7,如何从指定的屏幕位置读取字符?

时间:2017-04-04 18:20:37

标签: perl console

在perl程序控制下,是否有可能从屏幕上读取一个字符?

我使用的是Win32 :: Console :: ANSI和Term :: ANSIScreen。

我的perl程序可以将光标放在所需的字符上,并找到',但是我看不到将它读回到程序中。

getc不起作用,因为它要求我自己输入角色。

使用示例:在屏幕上填充数独谜题。

好的,我可以在Javascript中轻松完成,但我希望能够将结果写入本地文本文件,JS不会让我这样做。

或者,有没有办法将整个屏幕读取到内存中的字符串?

1 个答案:

答案 0 :(得分:0)

在模块Win32-Console中,您有例程

public CountModule(ArrayList<Mat> frames){

    fgGBG = new Mat(frames.get(0).rows(),frames.get(0).cols(),frames.get(0).type());
    gbg = createBackgroundSubtractorMOG2();
    Mat maTemp = new Mat(frames.get(0).rows(),frames.get(0).cols(),frames.get(0).type());

    median = new Mat(frames.get(0).rows(),frames.get(0).cols(),frames.get(0).type());
    frames.get(0).copyTo(median);
    ;
    median = getMedian(frames);
    kernel2 = Mat.ones(11,11,CV_8U).asMat();
    kernel = Mat.ones(3,1,CV_8U).asMat();
    gbg.apply(median,fgGBG,0.001);

}