Psychtoolbox-说明文字 [英] Psychtoolbox - Text for Instruction

查看:428
本文介绍了Psychtoolbox-说明文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Psychtoolbox屏幕和Textwindow时遇到一些问题... 对于我的实验,我想在开始时给出说明.我用了这样的东西: %用白色的Courier在屏幕中间绘制文本

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);

以及其他基本的屏幕定义. 问题是:文本没有完全显示.我尝试了不同的大小并将字体"设置为"Times",但是它始终是相同的-每个字母仅显示3/4(ca)...

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...

谢谢!

推荐答案

您能描述一下每个字母仅显示3/4(ca)"是什么意思吗?您发布的代码看起来正确.例如,这是该代码,并添加了一些设置例程,并将屏幕截图保存为"testImage.png",并附带了屏幕截图.

Can you describe what you mean by 'every letter is only displayed 3/4 (ca)"? The code you posted looks correct. For example, here is that code, with the addition of some set-up routines, and taking and saving a screenshot as "testImage.png", with the screen shot attached.

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');

这篇关于Psychtoolbox-说明文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆