<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.10.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSEPSImageRep/prepareGState()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSEPSImageRep(im)prepareGState"
  },
  "title" : "prepareGState()"
}
-->

# prepareGState()

Implemented by subclasses to configure the graphics state prior to drawing.

```
func prepareGState()
```

## Discussion

The [`draw()`](/documentation/AppKit/NSImageRep/draw()) method of [`NSEPSImageRep`](/documentation/AppKit/NSEPSImageRep) sends this message to itself just before rendering the EPS code. The default implementation of this method does nothing. You can override it in your subclass to prepare the graphics state as needed.

---

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)