# PutImage: Could not lock the offscreen surface for writing

**URL:** <https://psychtoolbox.discourse.group/t/putimage-could-not-lock-the-offscreen-surface-for-writing/1984>\
**Category:** Uncategorized\
**Created:** [May 31, 2006, 1:30am UTC](https://psychtoolbox.discourse.group/t/putimage-could-not-lock-the-offscreen-surface-for-writing/1984 "2006-05-31T01:30:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [May 31, 2006, 1:30am UTC](https://psychtoolbox.discourse.group/t/putimage-could-not-lock-the-offscreen-surface-for-writing/1984/1 "2006-05-31T01:30:13Z")

</div>

Sometimes, I have the following error. There is no way to continue   
except restart MatLab. Anyone knows what causes this problem? I use PTB   
2.54 under Windows XP. Thank you. -Xiangrui  
  
??? PutImage: Could not lock the offscreen surface for writing.  
Error in ==\> myCode at 82  
 Screen(w,'PutImage',img, rect);
