我们正在使用 Matlab 中的 Psychtoolbox 进行实验。我们要做的是将较小的图像(预先指定位置)放在大图像上。问题是,一旦我们尝试将较小的背景图像放在它上面,我们就会丢失背景图像。此外,每个图像始终居中,我们无法弄清楚如何将图像放置在指定位置。
我们已经尝试使用“DrawTextures”和“PutImage”来做到这一点,但到目前为止它失败了。你可以帮我们吗?
这是我们的一些代码:
[w,screenrect]=Screen('OpenWindow',screennr);
Screen(w,'fillrect',background_color);
Screen('Flip', w);
sr = [0 0 s_grootte s_grootte];
dst = CenterRect(sr,screenrect);
nr=max(Screen('Screens'));
Screen('PutImage', w, image); %% image is defined beforehand, ofcourse
%% We want to put smaller images on top of this
for i = 1:n_images:
% coordinates should be picked randomly from beforehand specified matrix
location_number = r(1,i);
coordinates = locations(location_number,:);
x = coordinates(1,1);
y = coordinates(1,2);
%% Now we have selected the coordinates, we want to place the smaller image on
%% that location
end