-
Notifications
You must be signed in to change notification settings - Fork 444
/
gdiPlusFlat2.h
66 lines (53 loc) · 2.27 KB
/
gdiPlusFlat2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _GDIPLUSFLAT_H
#define _GDIPLUSFLAT_H
#include <Windows.h>
#include "GdiPlusTypes2.h"
#include <GdiPlusEnums.h>
#include <GdiplusGpStubs.h>
#include <GdiPlusPixelFormats.h>
#define GDIPCONST const
#define WINGDIPAPI __stdcall
typedef Status GpStatus;
typedef GpStatus (WINGDIPAPI*
GdipDrawString)(
GpGraphics *graphics,
GDIPCONST WCHAR *string,
INT length,
GDIPCONST GpFont *font,
GDIPCONST RectF *layoutRect,
GDIPCONST GpStringFormat *stringFormat,
GDIPCONST GpBrush *brush
);//绘制文字的函数
typedef GpStatus (WINGDIPAPI*
GdipGetLogFontW)(GpFont * font, GpGraphics *graphics, LOGFONTW * logfontW);//从GPFont获取Logfont
typedef GpStatus (WINGDIPAPI*
GdipGetDC)(GpGraphics* graphics, HDC * hdc); //从GPGraphic获取HDC
typedef GpStatus (WINGDIPAPI*
GdipReleaseDC)(GpGraphics* graphics, HDC hdc);
typedef GpStatus (WINGDIPAPI*
GdipGetStringFormatAlign)(GDIPCONST GpStringFormat *format,
StringAlignment *align);
typedef GpStatus (WINGDIPAPI*
GdipGetStringFormatTrimming)(
GDIPCONST GpStringFormat *format,
StringTrimming *trimming
); //获取字符串的缩略方式。当字符串长度超过矩形长度时,将使用设置的方式删除中间的部分文字。
//转换成GDI后应使用DrawText来模拟。
typedef GpStatus (WINGDIPAPI*
GdipGetStringFormatHotkeyPrefix)(GDIPCONST GpStringFormat *format,
INT *hotkeyPrefix); //获取&符号的显示方式,隐藏,显示下划线或者不处理&。由DrawText模拟。
typedef GpStatus (WINGDIPAPI*
GdipGetBrushType)(GpBrush *brush, GpBrushType *type);
typedef GpStatus (WINGDIPAPI*
GdipGetSolidFillColor)(GpSolidFill *brush, ARGB *color); //获取单色Brush的颜色
extern GdipDrawString pfnGdipDrawString ;
extern GdipGetBrushType pfnGdipGetBrushType ;
extern GdipGetDC pfnGdipGetDC ;
extern GdipGetLogFontW pfnGdipGetLogFontW ;
extern GdipGetSolidFillColor pfnGdipGetSolidFillColor ;
extern GdipGetStringFormatAlign pfnGdipGetStringFormatAlign ;
extern GdipGetStringFormatHotkeyPrefix pfnGdipGetStringFormatHotkeyPrefix ;
extern GdipGetStringFormatTrimming pfnGdipGetStringFormatTrimming ;
extern GdipReleaseDC pfnGdipReleaseDC ;
bool InitGdiplusFuncs();
#endif