System::Drawing::Graphics::DrawString method

Graphics::DrawString(const String&, const SharedPtr<Font>&, const SharedPtr<Brush>&, float, float, const System::SharedPtr<System::Drawing::StringFormat>&) method

使用指定的字体和画刷在指定位置绘制指定的字符串。

void System::Drawing::Graphics::DrawString(const String &str, const SharedPtr<Font> &font, const SharedPtr<Brush> &brush, float x, float y, const System::SharedPtr<System::Drawing::StringFormat> &stringFormat=nullptr)
参数类型描述
strconst String&要绘制的字符串
字体const SharedPtr<Font>&要使用的字体
brushconst SharedPtr<Brush>&用于绘图的 Brush 对象
xfloat绘制字符串左上角位置的 X 坐标
yfloat绘制字符串左上角位置的 Y 坐标
stringFormatconst System::SharedPtr<System::Drawing::StringFormat>&指定字符串的格式

另见

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

使用指定的字体和画刷在指定位置绘制指定的字符串。

void System::Drawing::Graphics::DrawString(const String &str, const SharedPtr<Font> &font, const SharedPtr<Brush> &brush, PointF topLeft, const System::SharedPtr<System::Drawing::StringFormat> &stringFormat=nullptr)
参数类型描述
strconst String&要绘制的字符串
字体const SharedPtr<Font>&要使用的字体
brushconst SharedPtr<Brush>&用于绘图的 Brush 对象
topLeftPointF指定绘制字符串左上角的位置
stringFormatconst System::SharedPtr<System::Drawing::StringFormat>&指定字符串的格式

另见

Graphics::DrawString(const String&, const SharedPtr<Font>&, const SharedPtr<Brush>&, RectangleF, const System::SharedPtr<System::Drawing::StringFormat>&) method

使用指定的字体和画刷在指定的矩形内绘制指定的字符串。

void System::Drawing::Graphics::DrawString(const String &str, const SharedPtr<Font> &font, const SharedPtr<Brush> &brush, RectangleF layoutRectangle, const System::SharedPtr<System::Drawing::StringFormat> &stringFormat=nullptr)
参数类型描述
strconst String&要绘制的字符串
字体const SharedPtr<Font>&要使用的字体
brushconst SharedPtr<Brush>&用于绘图的 Brush 对象
layoutRectangleRectangleF指定用于绘制字符串的矩形
stringFormatconst System::SharedPtr<System::Drawing::StringFormat>&指定字符串的格式

另见