2022-05-21 19:58:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include "DrawingBase.h"
|
|
|
|
#include "Font.h"
|
|
|
|
#include "StringBase.h"
|
|
|
|
#include "TextFormatFlags.h"
|
|
|
|
|
|
|
|
#undef DrawText
|
|
|
|
|
|
|
|
namespace Drawing
|
|
|
|
{
|
|
|
|
// Provides methods for rendering text using GDI.
|
|
|
|
class TextRenderer
|
|
|
|
{
|
|
|
|
TextRenderer() = delete;
|
|
|
|
~TextRenderer() = delete;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Draws the specified text at the specified bounds using the provided color and format flags.
|
2022-05-21 21:51:35 +02:00
|
|
|
static void DrawText(HDC hDC, const String& Text, Font& Font, Rectangle Bounds, Color ForeColor, TextFormatFlags Flags = TextFormatFlags::Default);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Draws the specified text at the specified bounds using the provided color and format flags.
|
2022-05-21 21:51:35 +02:00
|
|
|
static void DrawText(std::unique_ptr<Drawing::Graphics>& Graphics, const String& Text, Font& Font, Rectangle Bounds, Color ForeColor, TextFormatFlags Flags = TextFormatFlags::Default);
|
2022-05-21 19:58:09 +02:00
|
|
|
};
|
|
|
|
}
|