<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugInInputImageSource/lockTextureRepresentation(with:forBounds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)QCPlugInInputImageSource(im)lockTextureRepresentationWithColorSpace:forBounds:"
  },
  "title" : "lockTextureRepresentation(with:forBounds:)"
}
-->

# lockTextureRepresentation(with:forBounds:)

Creates an OpenGL texture representation from a subregion of the image source using the provided color space.

```
func lockTextureRepresentation(with colorSpace: CGColorSpace!, forBounds bounds: NSRect) -> Bool
```

## Parameters

`colorSpace`

A Quartz color space.

`bounds`

The bounds of the subregion, expressed in pixels. They must be aligned to integer boundaries.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> is successful; <doc://com.apple.documentation/documentation/Swift/false> if texture can’t be created.

## Discussion

Neither the content of the texture nor its states (for example, the wrap mode) must be modified; you can only draw with it. The texture is valid only in the plug-in context.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)