canvas.copy() clears the original canvas?

5 views
Skip to first unread message

Christophe Pallier

unread,
Mar 18, 2021, 11:48:57 AM3/18/21
to expyriment-users
I am surprised that if I create a copy of a Canvas (and does not even touch it), the original Canvas appears to be cleared. On my system(Ubuntu 20.04, Anaconda Python 3.7.9, Experiment 0.10.0), the following code does not display anything iff the line 'c2= c.copy()' is executed:
```
import expyriment

exp = expyriment.design.Experiment(name="")

expyriment.control.initialize(exp)

stim = expyriment.stimuli.Picture('test.png')
c = expyriment.stimuli.Canvas((691, 1056), (0, 0))
stim.plot(c)

### comment or uncomment the following line and see the effect on diaply of 'c'
# c2 = c.copy()

expyriment.control.start()

c.present()
exp.clock.wait(2000)

expyriment.control.end()
```
test.png
Reply all
Reply to author
Forward
0 new messages