System::Drawing::Graphics::MeasureString method

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

Returns a size of the specified string when drawn in the specified font in the specified format.

SizeF System::Drawing::Graphics::MeasureString(String const &str, System::SharedPtr<Font> const &font, int width, System::SharedPtr<StringFormat> const &stringFormat=nullptr) const
ParameterTypeDescription
strString const&The string whose size to calculate
fontSystem::SharedPtr<Font> const&The font used to draw the string
widthintThe maximum width of the string
stringFormatSystem::SharedPtr<StringFormat> const&Specifies the string format

ReturnValue

A SizeF object that represents the size of the string in the measurment units specified by the PageUnit property of the current Grapphics object.

See Also

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

Returns a size of the specified string when drawn in the specified font in the specified format.

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
ParameterTypeDescription
strString const&The string whose size to calculate
fontSystem::SharedPtr<Font> const&The font used to draw the string
originPointF const&Specifies the location of the upper left corner of the string
stringFormatSystem::SharedPtr<StringFormat> const&Specifies the string format

ReturnValue

A SizeF object that represents the size of the string in the measurment units specified by the PageUnit property of the current Grapphics object.

See Also

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

NOT IMPLEMENTED.

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

See Also

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

Returns a size of the specified string when drawn in the specified font in the specified format.

SizeF System::Drawing::Graphics::MeasureString(String const &str, System::SharedPtr<Font> const &font, SizeF const &layoutArea, System::SharedPtr<StringFormat> const &stringFormat=nullptr) const
ParameterTypeDescription
strString const&The string whose size to calculate
fontSystem::SharedPtr<Font> const&The font used to draw the string
layoutAreaSizeF const&The maximum layout area of the string
stringFormatSystem::SharedPtr<StringFormat> const&Specifies the string format

ReturnValue

A SizeF object that represents the size of the string in the measurment units specified by the PageUnit property of the current Grapphics object.

See Also