Skip to content

Commit

Permalink
Release 23.11 - NET updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Samer El-Khatib committed Nov 29, 2023
1 parent 2d40e2e commit c847529
Show file tree
Hide file tree
Showing 55 changed files with 539 additions and 178 deletions.
12 changes: 6 additions & 6 deletions english/net/aspose.imaging.brushes/lineargradientbrush/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public sealed class LinearGradientBrush : LinearGradientBrushBase
| Name | Description |
| --- | --- |
| [LinearGradientBrush](lineargradientbrush)() | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class with default parameters. The starting color is black, the ending color is white, the angle is 45 degrees and the rectangle is located in (0,0) with size (1,1). |
| [LinearGradientBrush](lineargradientbrush)(PointPointColorColor) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class with the specified points and colors. |
| [LinearGradientBrush](lineargradientbrush)(PointFPointFColorColor) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class with the specified points and colors. |
| [LinearGradientBrush](lineargradientbrush)(RectangleColorColorfloat) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle. |
| [LinearGradientBrush](lineargradientbrush)(RectangleFColorColorfloat) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle. |
| [LinearGradientBrush](lineargradientbrush)(RectangleColorColorfloatbool) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle. |
| [LinearGradientBrush](lineargradientbrush)(RectangleFColorColorfloatbool) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle. |
| [LinearGradientBrush](lineargradientbrush)(PointPointColorColor) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class. |
| [LinearGradientBrush](lineargradientbrush)(PointFPointFColorColor) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class. |
| [LinearGradientBrush](lineargradientbrush)(RectangleColorColorfloat) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class. |
| [LinearGradientBrush](lineargradientbrush)(RectangleFColorColorfloat) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class. |
| [LinearGradientBrush](lineargradientbrush)(RectangleColorColorfloatbool) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class. |
| [LinearGradientBrush](lineargradientbrush)(RectangleFColorColorfloatbool) | Initializes a new instance of the [`LinearGradientBrush`](../lineargradientbrush) class. |

## Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@ url: /net/aspose.imaging.brushes/lineargradientbrush/lineargradientbrush/
---
## LinearGradientBrush constructor (1 of 7)

Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class with default parameters. The starting color is black, the ending color is white, the angle is 45 degrees and the rectangle is located in (0,0) with size (1,1).
Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class.

```csharp
public LinearGradientBrush()
public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle,
bool isAngleScalable)
```

| Parameter | Type | Description |
| --- | --- | --- |
| rect | RectangleF | The rectangle. |
| color1 | Color | The color1. |
| color2 | Color | The color2. |
| angle | Single | The angle. |
| isAngleScalable | Boolean | if set to `true` [is angle scalable]. |

### See Also

* struct [RectangleF](../../../aspose.imaging/rectanglef)
* struct [Color](../../../aspose.imaging/color)
* class [LinearGradientBrush](../../lineargradientbrush)
* namespace [Aspose.Imaging.Brushes](../../lineargradientbrush)
* assembly [Aspose.Imaging](../../../)
Expand All @@ -24,69 +35,24 @@ public LinearGradientBrush()

## LinearGradientBrush constructor (2 of 7)

Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class with the specified points and colors.
Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class.

```csharp
public LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)
public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle,
bool isAngleScalable)
```

| Parameter | Type | Description |
| --- | --- | --- |
| point1 | Point | A [`Point`](../../../aspose.imaging/point) structure that represents the starting point of the linear gradient. |
| point2 | Point | A [`Point`](../../../aspose.imaging/point) structure that represents the endpoint of the linear gradient. |
| color1 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the starting color of the linear gradient. |
| color2 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the ending color of the linear gradient. |

### Examples

The following example shows how to create a grayscale copy of an existing frame and add it to a TIFF image.

```csharp
[C#]

string dir = "c:\\temp\\";

Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

// Create a permanent, not temporary file source.
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };

using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// The linear gradient from the left-top to the right-bottom corner of the image.
Aspose.Imaging.Brushes.LinearGradientBrush brush =
new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(tiffImage.Width, tiffImage.Height),
Aspose.Imaging.Color.Red,
Aspose.Imaging.Color.Green);

// Fill the active frame with a linear gradient brush.
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(tiffImage.ActiveFrame);
gr.FillRectangle(brush, tiffImage.Bounds);

// Grayscale options
Aspose.Imaging.ImageOptions.TiffOptions createTiffFrameOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffFrameOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
createTiffFrameOptions.Photometric = Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
createTiffFrameOptions.BitsPerSample = new ushort[] { 8 };

// Create a grayscale copy of the active frame.
// The pixel data is preserved but converted to the desired format.
Aspose.Imaging.FileFormats.Tiff.TiffFrame grayscaleFrame = Aspose.Imaging.FileFormats.Tiff.TiffFrame.CreateFrameFrom(tiffImage.ActiveFrame, createTiffFrameOptions);

// Add the newly created frame to the TIFF image.
tiffImage.AddFrame(grayscaleFrame);

tiffImage.Save();
}
```
| rect | Rectangle | The rectangle. |
| color1 | Color | The color1. |
| color2 | Color | The color2. |
| angle | Single | The angle. |
| isAngleScalable | Boolean | if set to `true` [is angle scalable]. |

### See Also

* struct [Point](../../../aspose.imaging/point)
* struct [Rectangle](../../../aspose.imaging/rectangle)
* struct [Color](../../../aspose.imaging/color)
* class [LinearGradientBrush](../../lineargradientbrush)
* namespace [Aspose.Imaging.Brushes](../../lineargradientbrush)
Expand All @@ -96,22 +62,22 @@ using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.Fil

## LinearGradientBrush constructor (3 of 7)

Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class with the specified points and colors.
Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class.

```csharp
public LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)
public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle)
```

| Parameter | Type | Description |
| --- | --- | --- |
| point1 | PointF | A [`PointF`](../../../aspose.imaging/pointf) structure that represents the starting point of the linear gradient. |
| point2 | PointF | A [`PointF`](../../../aspose.imaging/pointf) structure that represents the endpoint of the linear gradient. |
| color1 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the starting color of the linear gradient. |
| color2 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the ending color of the linear gradient. |
| rect | RectangleF | The rectangle. |
| color1 | Color | The color1. |
| color2 | Color | The color2. |
| angle | Single | The angle. |

### See Also

* struct [PointF](../../../aspose.imaging/pointf)
* struct [RectangleF](../../../aspose.imaging/rectanglef)
* struct [Color](../../../aspose.imaging/color)
* class [LinearGradientBrush](../../lineargradientbrush)
* namespace [Aspose.Imaging.Brushes](../../lineargradientbrush)
Expand All @@ -121,18 +87,18 @@ public LinearGradientBrush(PointF point1, PointF point2, Color color1, Color col

## LinearGradientBrush constructor (4 of 7)

Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle.
Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class.

```csharp
public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle)
```

| Parameter | Type | Description |
| --- | --- | --- |
| rect | Rectangle | A [`RectangleF`](../../../aspose.imaging/rectanglef) structure that specifies the bounds of the linear gradient. |
| color1 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the starting color for the gradient. |
| color2 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the ending color for the gradient. |
| angle | Single | The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line. |
| rect | Rectangle | The rectangle. |
| color1 | Color | The color1. |
| color2 | Color | The color2. |
| angle | Single | The angle. |

### See Also

Expand All @@ -146,22 +112,22 @@ public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float ang

## LinearGradientBrush constructor (5 of 7)

Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle.
Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class.

```csharp
public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle)
public LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)
```

| Parameter | Type | Description |
| --- | --- | --- |
| rect | RectangleF | A [`RectangleF`](../../../aspose.imaging/rectanglef) structure that specifies the bounds of the linear gradient. |
| color1 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the starting color for the gradient. |
| color2 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the ending color for the gradient. |
| angle | Single | The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line. |
| point1 | PointF | The point1. |
| point2 | PointF | The point2. |
| color1 | Color | The color1. |
| color2 | Color | The color2. |

### See Also

* struct [RectangleF](../../../aspose.imaging/rectanglef)
* struct [PointF](../../../aspose.imaging/pointf)
* struct [Color](../../../aspose.imaging/color)
* class [LinearGradientBrush](../../lineargradientbrush)
* namespace [Aspose.Imaging.Brushes](../../lineargradientbrush)
Expand All @@ -171,24 +137,69 @@ public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float an

## LinearGradientBrush constructor (6 of 7)

Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle.
Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class.

```csharp
public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle,
bool isAngleScalable)
public LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)
```

| Parameter | Type | Description |
| --- | --- | --- |
| rect | Rectangle | A [`RectangleF`](../../../aspose.imaging/rectanglef) structure that specifies the bounds of the linear gradient. |
| color1 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the starting color for the gradient. |
| color2 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the ending color for the gradient. |
| angle | Single | The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line. |
| isAngleScalable | Boolean | if set to `true` the angle is changed during transformations with this [`LinearGradientBrush`](../../lineargradientbrush). |
| point1 | Point | The point1. |
| point2 | Point | The point2. |
| color1 | Color | The color1. |
| color2 | Color | The color2. |

### Examples

The following example shows how to create a grayscale copy of an existing frame and add it to a TIFF image.

```csharp
[C#]

string dir = "c:\\temp\\";

Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

// Create a permanent, not temporary file source.
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };

using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// The linear gradient from the left-top to the right-bottom corner of the image.
Aspose.Imaging.Brushes.LinearGradientBrush brush =
new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(tiffImage.Width, tiffImage.Height),
Aspose.Imaging.Color.Red,
Aspose.Imaging.Color.Green);

// Fill the active frame with a linear gradient brush.
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(tiffImage.ActiveFrame);
gr.FillRectangle(brush, tiffImage.Bounds);

// Grayscale options
Aspose.Imaging.ImageOptions.TiffOptions createTiffFrameOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffFrameOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
createTiffFrameOptions.Photometric = Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
createTiffFrameOptions.BitsPerSample = new ushort[] { 8 };

// Create a grayscale copy of the active frame.
// The pixel data is preserved but converted to the desired format.
Aspose.Imaging.FileFormats.Tiff.TiffFrame grayscaleFrame = Aspose.Imaging.FileFormats.Tiff.TiffFrame.CreateFrameFrom(tiffImage.ActiveFrame, createTiffFrameOptions);

// Add the newly created frame to the TIFF image.
tiffImage.AddFrame(grayscaleFrame);

tiffImage.Save();
}
```

### See Also

* struct [Rectangle](../../../aspose.imaging/rectangle)
* struct [Point](../../../aspose.imaging/point)
* struct [Color](../../../aspose.imaging/color)
* class [LinearGradientBrush](../../lineargradientbrush)
* namespace [Aspose.Imaging.Brushes](../../lineargradientbrush)
Expand All @@ -198,25 +209,14 @@ public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float ang

## LinearGradientBrush constructor (7 of 7)

Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class based on a rectangle, starting and ending colors, and an orientation angle.
Initializes a new instance of the [`LinearGradientBrush`](../../lineargradientbrush) class with default parameters. The starting color is black, the ending color is white, the angle is 45 degrees and the rectangle is located in (0,0) with size (1,1).

```csharp
public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle,
bool isAngleScalable)
public LinearGradientBrush()
```

| Parameter | Type | Description |
| --- | --- | --- |
| rect | RectangleF | A [`RectangleF`](../../../aspose.imaging/rectanglef) structure that specifies the bounds of the linear gradient. |
| color1 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the starting color for the gradient. |
| color2 | Color | A [`Color`](../../../aspose.imaging/color) structure that represents the ending color for the gradient. |
| angle | Single | The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line. |
| isAngleScalable | Boolean | if set to `true` the angle is changed during transformations with this [`LinearGradientBrush`](../../lineargradientbrush). |

### See Also

* struct [RectangleF](../../../aspose.imaging/rectanglef)
* struct [Color](../../../aspose.imaging/color)
* class [LinearGradientBrush](../../lineargradientbrush)
* namespace [Aspose.Imaging.Brushes](../../lineargradientbrush)
* assembly [Aspose.Imaging](../../../)
Expand Down
Loading

0 comments on commit c847529

Please sign in to comment.