We are using the Psychtoolbox in Matlab to make an experiment. We want to do is placing smaller images (locations are specified beforehand) over a large one. The trouble is that we lose the background image once we try putting the smaller ones on top of it. Also, every image is always centered and we are having trouble figuring out how to place the images in the specified locations.
We have tried doing this using 'DrawTextures' and 'PutImage', but it is failing so far. Could you help us?
Here is some of our code:
[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