Skip to content

Commit

Permalink
Update file(s) "/." from "aspose-psd/Aspose.PSD-API-References"
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsa committed Jan 22, 2025
1 parent 25c5297 commit f69d87b
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,41 @@ public int PageCount { get; }

The number of pages.

## Examples

The following code demonstrates support of AiImage property for number of pages AiImage.PageCount.

```csharp
[C#]

string sourceFile = "2241.ai";
string[] outputFiles = new string[3]
{
"2241_pageNumber_0.png",
"2241_pageNumber_1.png",
"2241_pageNumber_2.png",
};

void AssertAreEqual(object expected, object actual)
{
if (!object.Equals(expected, actual))
{
throw new Exception("Objects are not equal.");
}
}

using (AiImage image = (AiImage)Image.Load(sourceFile))
{
AssertAreEqual(image.PageCount, 3);

for (int i = 0; i < image.PageCount; i++)
{
image.ActivePageIndex = i;
image.Save(outputFiles[i], new PngOptions());
}
}
```

### See Also

* class [AiImage](../)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ public class SmartObjectLayer : Layer
| [ReplaceContents](../../aspose.psd.fileformats.psd.layers.smartobjects/smartobjectlayer/replacecontents/#replacecontents)(Image) | Replaces the smart object contents embedded in the smart object layer. |
| [ReplaceContents](../../aspose.psd.fileformats.psd.layers.smartobjects/smartobjectlayer/replacecontents/#replacecontents_2)(string) | Replaces the contents with a file. There is no need to call UpdateModifiedContent method afterwards. |
| [ReplaceContents](../../aspose.psd.fileformats.psd.layers.smartobjects/smartobjectlayer/replacecontents/#replacecontents_1)(ImageResolutionSetting) | Replaces the smart object contents embedded in the smart object layer. |
| [ReplaceContents](../../aspose.psd.fileformats.psd.layers.smartobjects/smartobjectlayer/replacecontents/#replacecontents_5)(stringbool) | Replaces the contents with a file. There is no need to call UpdateModifiedContent method afterwards. |
| [ReplaceContents](../../aspose.psd.fileformats.psd.layers.smartobjects/smartobjectlayer/replacecontents/#replacecontents_3)(stringResolutionSetting) | Replaces the contents with a file. There is no need to call UpdateModifiedContent method afterwards. |
| [ReplaceContents](../../aspose.psd.fileformats.psd.layers.smartobjects/smartobjectlayer/replacecontents/#replacecontents_4)(stringResolutionSettingbool) | Replaces the contents with a file. There is no need to call UpdateModifiedContent method afterwards. |
| [ReplaceNonTransparentColors](../../aspose.psd/rasterimage/replacenontransparentcolors/)(Color) | Replaces all non-transparent colors with new color and preserves original alpha value to save smooth edges. Note: if you use it on images without transparency, all colors will be replaced with a single one. |
| virtual [ReplaceNonTransparentColors](../../aspose.psd/rasterimage/replacenontransparentcolors/)(int) | Replaces all non-transparent colors with new color and preserves original alpha value to save smooth edges. Note: if you use it on images without transparency, all colors will be replaced with a single one. |
| [Resize](../../aspose.psd/image/resize/)(intint) | Resizes the image. The default NearestNeighbourResample is used. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,29 @@ public void ReplaceContents(string linkedPath, ResolutionSetting resolution)
| linkedPath | String | The linked path. |
| resolution | ResolutionSetting | The resolution settings. If null the image resolution will be used. |

### See Also

* class [ResolutionSetting](../../../aspose.psd/resolutionsetting/)
* class [SmartObjectLayer](../)
* namespace [Aspose.PSD.FileFormats.Psd.Layers.SmartObjects](../../../aspose.psd.fileformats.psd.layers.smartobjects/)
* assembly [Aspose.PSD](../../../)

---

## ReplaceContents(string, ResolutionSetting, bool) {#replacecontents_4}

Replaces the contents with a file. There is no need to call UpdateModifiedContent method afterwards.

```csharp
public void ReplaceContents(string linkedPath, ResolutionSetting resolution, bool isReplaceOnlyThis)
```

| Parameter | Type | Description |
| --- | --- | --- |
| linkedPath | String | The linked path. |
| resolution | ResolutionSetting | The resolution settings. If null the image resolution will be used. |
| isReplaceOnlyThis | Boolean | The flag shows replace content from this Smart Layer or to all Smart Layers with this content |

## Examples

This example demonstrates that the ReplaceContents method works correctly when the new content file has a different resolution.
Expand Down Expand Up @@ -230,6 +253,27 @@ public void ReplaceContents(string linkedPath)
| --- | --- | --- |
| linkedPath | String | The linked path. |

### See Also

* class [SmartObjectLayer](../)
* namespace [Aspose.PSD.FileFormats.Psd.Layers.SmartObjects](../../../aspose.psd.fileformats.psd.layers.smartobjects/)
* assembly [Aspose.PSD](../../../)

---

## ReplaceContents(string, bool) {#replacecontents_5}

Replaces the contents with a file. There is no need to call UpdateModifiedContent method afterwards.

```csharp
public void ReplaceContents(string linkedPath, bool isReplaceOnlyThis)
```

| Parameter | Type | Description |
| --- | --- | --- |
| linkedPath | String | The linked path. |
| isReplaceOnlyThis | Boolean | The flag shows replace content from this Smart Layer or to all Smart Layers with this content |

## Examples

The following code demonstrates the support of updating Linked Smart objects.
Expand Down

0 comments on commit f69d87b

Please sign in to comment.