# ImageCollection.CopyTo Method

> Copies the elements of the collection to an array, starting at a particular index.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > ImageCollection.CopyTo Method
- **800 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/imagecollection/copyto-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/imagecollection/copyto-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/imagecollection/copyto-method/llms-full.txt

---

### Description

Copies the elements of the collection to an array, starting at a particular index.

### Syntax

```csharp
public override void CopyTo(Array array, int index);
```

```vbnet
Public Overrides Sub CopyTo(array As Array, index As Integer)
```

### Parameters

| Parameter | Description |
|---|---|
| array | Specifies the array to copy to. |
| index | Specifies the index of the destination array at which to begin copying. |

### Examples

The following example copies document images to an array before applying consistent export settings.

```csharp
TXTextControl.Image logo = new() { FileName = @"Images\company-logo.png", Name = "CompanyLogo", DescriptiveText = "Company logo" };
textControl.Images.Add(logo, -1);
TXTextControl.Image[] images = new TXTextControl.Image[textControl.Images.Count];
textControl.Images.CopyTo(images, 0);
foreach (TXTextControl.Image image in images)
{
    image.ExportCompressionQuality = 90;
    image.ExportMaxResolution = 150;
}
```

```vbnet
Dim logo As New TXTextControl.Image() With { .FileName = "Images\company-logo.png", .Name = "CompanyLogo", .DescriptiveText = "Company logo" }
textControl.Images.Add(logo, -1)
Dim images(textControl.Images.Count - 1) As TXTextControl.Image
textControl.Images.CopyTo(images, 0)
For Each image As TXTextControl.Image In images
    image.ExportCompressionQuality = 90
    image.ExportMaxResolution = 150
Next
```

---

## Nearby

- **Previous:** [ImageCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/imagecollection/add-method/llms-full.txt)
- **Next:** [ImageCollection.ExportFilters Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/imagecollection/exportfilters-property/llms-full.txt)
