---
title: "StreamWrapper..::.LockRegion Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_StreamWrapper_LockRegion_3_c26e67f0.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# StreamWrapper.LockRegion Method 
 
Restricts access to a specified range of bytes in the stream.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Overridable Sub LockRegion ( _libOffset As Long, _cb As Long, _dwLockType As Integer _
)
```
 
```csharp
public virtual void LockRegion(long libOffset,long cb,int dwLockType
)
```
 
### Parameters
 
 - libOffset
     - Type: [System.Int64](http://msdn2.microsoft.com/en-us/6yy583ek)
The byte offset for the beginning of the range.

 - cb
     - Type: [System.Int64](http://msdn2.microsoft.com/en-us/6yy583ek)
The length of the range, in bytes, to restrict.

 - dwLockType
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
The requested restrictions on accessing the range.
 
### Implements
 
[IStream.LockRegion(Int64, Int64, Int32)](http://msdn2.microsoft.com/en-us/tckfdhf6)
 
## Remarks
 For more information, please see the existing documentation for **IStream::LockRegion** in the MSDN library.
   
## See Also

### Reference

- [StreamWrapper Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_StreamWrapper.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
