0

I have some problems using Psychtoolbox Screen and Textwindow... For my experiment I want to give an instruction at the beginning. I used something like this: % Draw text in the middle of the screen in Courier in white

Screen('TextSize', window, 20);
Screen('TextFont', window, 'Courier');
DrawFormattedText(window, 'Hello World', 'center', 'center', white);

And the other basic Screen definitions. The problem is: The text is not fully shown. I tried different sizes and set the Font to Times, but it is always the same - every letter is only displayed 3/4 (ca)...

What could be the problem? Would be very nice if someone can give me a hint...

Thanks!

Letters are cut

4

2 回答 2

1

你能描述一下“每个字母只显示 3/4 (ca)”是什么意思吗?你发布的代码看起来是正确的。例如,这里是那个代码,添加了一些设置例程,以及获取和保存屏幕截图为“testImage.png”,附有屏幕截图。

screenNum = max(Screen('Screens'));
window = Screen('OpenWindow', screenNum, 0);
white = WhiteIndex(window);
Screen('TextSize', window, 20);
Screen('TextFont', window, 'Courier');
DrawFormattedText(window, 'Hello World', 'center', 'center', white)
Screen('Flip', window);
imageArray = Screen('GetImage', window);
WaitSecs(3);
Screen('CloseAll');
imwrite(imageArray, 'testImage.png');

以上代码生成的屏幕截图

于 2017-08-17T21:59:10.023 回答
0

我发现了问题......我的长代码中只是一个愚蠢的错误。我之前已经设置了文本的字体和大小,这干扰了这个新的文本功能。尽管如此,还是感谢您的帮助!

于 2017-08-18T19:17:35.067 回答