---
Product: Aspose.Slides
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/slides/java/sizef
---

# SizeF

## Overview

`SizeF` is a class in Aspose.Slides FOSS for Java.

Represents a 2D size with float dimensions.

This class declares 12 methods for SizeF objects in Java programs.
Available methods include: `SizeF`, `add`, `equals`, `getHeight`, `getWidth`, `hashCode`, `isEmpty`, `setHeight`, `setWidth`, `toSize`, `toString`.
Public members are accessible to any Java application after installing the Aspose.Slides FOSS for Java package.
Properties: `EMPTY`, `empty`, `height`, `width`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `width` | `float` | Read/Write | Gets the width. |
| `height` | `float` | Read/Write | Gets the height. |
| `empty` | `boolean` | Read | Returns {@code true} if both dimensions are zero. |
| `EMPTY` | `SizeF` | Read | Empty size with dimensions (0, 0). |

## Methods

| Signature | Description |
|-----------|-------------|
| `SizeF(width: float, height: float)` | Initializes a new instance of SizeF with the specified dimensions. |
| `SizeF()` | Initializes a new instance of SizeF with dimensions (0, 0). |
| `getWidth()` → `float` | Gets the width. |
| `setWidth(width: float)` | Sets the width. |
| `getHeight()` → `float` | Gets the height. |
| `setHeight(height: float)` | Sets the height. |
| `isEmpty()` → `boolean` | Returns {@code true} if both dimensions are zero. |
| `add(a: SizeF, b: SizeF)` → `SizeF` | Adds two sizes component-wise. |
| `toSize()` → `Size` | Converts this SizeF to a Size by truncating to integer dimensions. |
| `equals(obj: Object)` → `boolean` | Calls equals(obj) on this SizeF instance. |
| `hashCode()` → `int` | Returns a hash code based on the size's dimensions |
| `toString()` → `String` | Calls toString on this SizeF instance. |

## See Also

- [Aspose.Slides — Enterprise API Reference](https://reference.aspose.com/slides/)