---
title: "CmxFillStyle"
url: "https://reference.aspose.com/imaging/java/com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmxfillstyle/"
product: "Aspose.Imaging for Java API Reference"
description: "Fill style for shapes."
---

**Inheritance:**
java.lang.Object
```
public class CmxFillStyle
```

Fill style for shapes.
## Constructors

| Constructor | Description |
| --- | --- |
| [CmxFillStyle()](#CmxFillStyle--) |  |
## Methods

| Method | Description |
| --- | --- |
| [getFillType()](#getFillType--) | Gets the type of the fill. |
| [setFillType(int value)](#setFillType-int-) | Sets the type of the fill. |
| [getColor1()](#getColor1--) | Gets the primary color. |
| [setColor1(CmxColor value)](#setColor1-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxColor-) | Sets the primary color. |
| [getColor2()](#getColor2--) | Gets the secondary color. |
| [setColor2(CmxColor value)](#setColor2-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxColor-) | Sets the secondary color. |
| [getGradient()](#getGradient--) | Gets the gradient info. |
| [setGradient(CmxGradient value)](#setGradient-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxGradient-) | Sets the gradient info. |
| [getImageFill()](#getImageFill--) | Gets the image fill info. |
| [setImageFill(CmxImageFill value)](#setImageFill-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxImageFill-) | Sets the image fill info. |
| [getTransform()](#getTransform--) | Gets the fill transform. |
| [setTransform(Matrix value)](#setTransform-com.aspose.imaging.Matrix-) | Sets the fill transform. |
| [toString()](#toString--) | Returns a String that represents this instance. |
| [equals(Object o)](#equals-java.lang.Object-) | Check if objects are equal. |
| [hashCode()](#hashCode--) | Get hash code of the current object. |
### CmxFillStyle() {#CmxFillStyle--}
```
public CmxFillStyle()
```


### getFillType() {#getFillType--}
```
public final int getFillType()
```


Gets the type of the fill.

**Returns:**
int - the type of the fill.
### setFillType(int value) {#setFillType-int-}
```
public final void setFillType(int value)
```


Sets the type of the fill.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | int | the type of the fill. |

### getColor1() {#getColor1--}
```
public final CmxColor getColor1()
```


Gets the primary color.

**Returns:**
[CmxColor](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmxcolor) - the primary color.
### setColor1(CmxColor value) {#setColor1-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxColor-}
```
public final void setColor1(CmxColor value)
```


Sets the primary color.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | [CmxColor](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmxcolor) | the primary color. |

### getColor2() {#getColor2--}
```
public final CmxColor getColor2()
```


Gets the secondary color.

**Returns:**
[CmxColor](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmxcolor) - the secondary color.
### setColor2(CmxColor value) {#setColor2-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxColor-}
```
public final void setColor2(CmxColor value)
```


Sets the secondary color.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | [CmxColor](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmxcolor) | the secondary color. |

### getGradient() {#getGradient--}
```
public final CmxGradient getGradient()
```


Gets the gradient info.

**Returns:**
[CmxGradient](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmxgradient) - the gradient info.
### setGradient(CmxGradient value) {#setGradient-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxGradient-}
```
public final void setGradient(CmxGradient value)
```


Sets the gradient info.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | [CmxGradient](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmxgradient) | the gradient info. |

### getImageFill() {#getImageFill--}
```
public final CmxImageFill getImageFill()
```


Gets the image fill info.

**Returns:**
[CmxImageFill](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmximagefill) - the image fill info.
### setImageFill(CmxImageFill value) {#setImageFill-com.aspose.imaging.fileformats.cmx.objectmodel.styles.CmxImageFill-}
```
public final void setImageFill(CmxImageFill value)
```


Sets the image fill info.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | [CmxImageFill](../../com.aspose.imaging.fileformats.cmx.objectmodel.styles/cmximagefill) | the image fill info. |

### getTransform() {#getTransform--}
```
public final Matrix getTransform()
```


Gets the fill transform.

**Returns:**
[Matrix](../../com.aspose.imaging/matrix) - the fill transform.
### setTransform(Matrix value) {#setTransform-com.aspose.imaging.Matrix-}
```
public final void setTransform(Matrix value)
```


Sets the fill transform.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | [Matrix](../../com.aspose.imaging/matrix) | the fill transform. |

### toString() {#toString--}
```
public String toString()
```


Returns a String that represents this instance.

**Returns:**
java.lang.String - A String that represents this instance.
### equals(Object o) {#equals-java.lang.Object-}
```
public boolean equals(Object o)
```


Check if objects are equal.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| o | java.lang.Object | The other object. |

**Returns:**
boolean - The equality comparison result.
### hashCode() {#hashCode--}
```
public int hashCode()
```


Get hash code of the current object.

**Returns:**
int - The hash code.
