## Graphics::MeasureString(String const\&, System::SharedPtr\<Font\> const\&, int, System::SharedPtr\<StringFormat\> const\&) const method


返回在指定字体和指定格式下绘制指定字符串的尺寸。

```cpp
SizeF System::Drawing::Graphics::MeasureString(String const &str, System::SharedPtr<Font> const &font, int width, System::SharedPtr<StringFormat> const &stringFormat=nullptr) const
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| str | String const\& | 要计算大小的字符串 |
| 字体 | System::SharedPtr\<Font\> const\& | 用于绘制字符串的字体 |
| width | int | 字符串的最大宽度 |
| stringFormat | System::SharedPtr\<StringFormat\> const\& | 指定字符串格式 |

### ReturnValue

一个 [SizeF](../../sizef/) 对象，表示字符串的大小，使用当前 Graphics 对象的 PageUnit 属性指定的测量单位。

## 另见

* Class [SizeF](../../sizef/)
* Class [String](../../../system/string/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Font](../../font/)
* Class [StringFormat](../../stringformat/)
* Class [Graphics](../)
* Namespace [System::Drawing](../../)
* Library [Aspose.Page for C++](../../../)
## Graphics::MeasureString(String const\&, System::SharedPtr\<Font\> const\&, PointF const\&, System::SharedPtr\<StringFormat\> const\&) const method


返回在指定字体和指定格式下绘制指定字符串的尺寸。

```cpp
SizeF System::Drawing::Graphics::MeasureString(String const &str, System::SharedPtr<Font> const &font, PointF const &origin=PointF(0, 0), System::SharedPtr<StringFormat> const &stringFormat=nullptr) const
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| str | String const\& | 要计算大小的字符串 |
| 字体 | System::SharedPtr\<Font\> const\& | 用于绘制字符串的字体 |
| origin | PointF const\& | 指定字符串左上角的位置 |
| stringFormat | System::SharedPtr\<StringFormat\> const\& | 指定字符串格式 |

### ReturnValue

一个 [SizeF](../../sizef/) 对象，表示字符串的大小，使用当前 Graphics 对象的 PageUnit 属性指定的测量单位。

## 另见

* Class [SizeF](../../sizef/)
* Class [String](../../../system/string/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Font](../../font/)
* Class [PointF](../../pointf/)
* Class [StringFormat](../../stringformat/)
* Class [Graphics](../)
* Namespace [System::Drawing](../../)
* Library [Aspose.Page for C++](../../../)
## Graphics::MeasureString(String const\&, System::SharedPtr\<Font\> const\&, SizeF const\&, System::SharedPtr\<StringFormat\> const\&, int\&, int\&) const method


未实现。

```cpp
SizeF System::Drawing::Graphics::MeasureString(String const &str, System::SharedPtr<Font> const &font, SizeF const &layoutArea, System::SharedPtr<StringFormat> const &stringFormat, int &charactersFitted, int &linesFilled) const
```


## 另见

* Class [SizeF](../../sizef/)
* Class [String](../../../system/string/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Font](../../font/)
* Class [StringFormat](../../stringformat/)
* Class [Graphics](../)
* Namespace [System::Drawing](../../)
* Library [Aspose.Page for C++](../../../)
## Graphics::MeasureString(String const\&, System::SharedPtr\<Font\> const\&, SizeF const\&, System::SharedPtr\<StringFormat\> const\&) const method


返回在指定字体和指定格式下绘制指定字符串的尺寸。

```cpp
SizeF System::Drawing::Graphics::MeasureString(String const &str, System::SharedPtr<Font> const &font, SizeF const &layoutArea, System::SharedPtr<StringFormat> const &stringFormat=nullptr) const
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| str | String const\& | 要计算大小的字符串 |
| 字体 | System::SharedPtr\<Font\> const\& | 用于绘制字符串的字体 |
| layoutArea | SizeF const\& | 字符串的最大布局区域 |
| stringFormat | System::SharedPtr\<StringFormat\> const\& | 指定字符串格式 |

### ReturnValue

一个 [SizeF](../../sizef/) 对象，表示字符串的大小，使用当前 Graphics 对象的 PageUnit 属性指定的测量单位。

## 另见

* Class [SizeF](../../sizef/)
* Class [String](../../../system/string/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Font](../../font/)
* Class [StringFormat](../../stringformat/)
* Class [Graphics](../)
* Namespace [System::Drawing](../../)
* Library [Aspose.Page for C++](../../../)
