---
title: CMSetProfileElement
framework: Application Services
role: pseudoSymbol
platforms: []
path: applicationservices/colorsync_manager/1804977-cmsetprofileelement
---

# CMSetProfileElement

Sets or replaces the element data for a specific tag in the specified profile. 

## Declaration

```occ
CMError CMSetProfileElement (
   CMProfileRef prof,
   OSType tag,
   UInt32 elementSize,
   const void *elementData
);
```

## Parameters

- `prof`: A profile reference of type [doc://com.apple.documentation/documentation/applicationservices/cmprofileref](applicationservices/cmprofileref.md) to the profile containing the tag for which the element data is set.
- `tag`: The tag signature for the element whose data is set. For a complete list of the tag signatures a profile may contain, including a description of each tag, refer to the International Color Consortium Profile Format Specification. The signatures for profile tags are defined in the `CMICCProfile.h` header file.
- `elementSize`: The size in bytes of the element data set.
- `elementData`: A pointer to the buffer containing the element data to transfer to the profile.

## Return Value

A `CMError` value. See [Result Codes](../colorsync_manager.md).

## Overview

The `CMSetProfileElement` function replaces existing element data if an element with the specified tag is already present in the profile. Otherwise, it sets the element data for a new tag. Your application is responsible for allocating memory for the buffer to hold the data to transfer. 

## See Also

### Accessing Profile Elements

- [CMCountProfileElements](1804963-cmcountprofileelements.md)
- [CMProfileElementExists](1804967-cmprofileelementexists.md)
- [CMGetProfileElement](1804973-cmgetprofileelement.md)
- [CMSetProfileElementSize](1804980-cmsetprofileelementsize.md)
- [CMGetPartialProfileElement](1804984-cmgetpartialprofileelement.md)
- [CMSetPartialProfileElement](1804989-cmsetpartialprofileelement.md)
- [CMGetIndProfileElementInfo](1804996-cmgetindprofileelementinfo.md)
- [CMGetIndProfileElement](1805002-cmgetindprofileelement.md)
- [CMSetProfileElementReference](1805005-cmsetprofileelementreference.md)
- [CMRemoveProfileElement](1805008-cmremoveprofileelement.md)
