필터 지우기
필터 지우기

Why does DrawFormattedText 'clip' words when they are flipped to screen (in psychtoolbox)?

조회 수: 20 (최근 30일)
Hi there,
I've written a piece of code using psychtoolbox that appears to 'clip' only the top half of the instructions when they are flipped to screen. Below is an example of the code:
%load basic parameters for psychotoolbox
PsychDefaultSetup(2);
Screen('Preference', 'SkipSyncTests', 1);
screens = Screen('Screens');
screenNumber = max(screens)
white = WhiteIndex(screenNumber); black = BlackIndex(screenNumber);
[window, windowRect] = PsychImaging('OpenWindow', screenNumber, black);
[screenXpixels, screenYpixels] = Screen('WindowSize', window);
[xCenter, yCenter] = RectCenter(windowRect);
Screen('BlendFunction', window, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');
%Flip text to screen
[nx, ny, textbounds, wordbounds] = DrawFormattedText(window, 'Hello genius!', 'center', 'center', white);
Screen('Flip', window);
KbStrokeWait; sca;
I've included the global function for disabling the clipping but this doesn't seem to work (ptb_drawformattedtext_disableClipping = 1; ). Clipping appears for every row of my instructions flipped to screen. Does anyone know what is going on?
I'm using matlab 9.4.0.813654 (R2018a), psychtoolbox 3.0.15.
Many thanks!

답변 (1개)

Grace Steward
Grace Steward 2019년 7월 12일
Hello,
I had a similar problem, and it turns out that PsychToolbox doesn't handle display scaling well at all. So you might be getting clipping due to your display screen being scaled to something above 100%. You can change that in your display settings panel.
Hope that helps.

카테고리

Help CenterFile Exchange에서 Timing and presenting 2D and 3D stimuli에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by