Graphviz 16.1.1~dev.20261005.1347
Loading...
Searching...
No Matches
gvplugin_gdiplus.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#include <memory>
14#include <vector>
15
16#include <windows.h>
17#include <gdiplus.h>
18
19enum {
29};
30
31/* RAII for GetDC/ReleaseDC */
32
34{
35 HDC hdc;
36
37 DeviceContext(): hdc(GetDC(nullptr))
38 {
39 }
40
42 {
43 ReleaseDC(nullptr, hdc);
44 }
45
46};
47
48/* textlayout etc. */
49
50struct Layout
51{
52 std::unique_ptr<Gdiplus::Font> font;
53 std::vector<WCHAR> text;
54
55 Layout(char *fontname, double fontsize, char* string);
56};
57
58extern "C" void gdiplus_free_layout(void *layout);
59
60void UseGdiplus();
61const Gdiplus::StringFormat* GetGenericTypographic();
62void SaveBitmapToStream(Gdiplus::Bitmap &bitmap, IStream *stream, int format);
GVIO_API const char * format
Definition gvio.h:51
void gdiplus_free_layout(void *layout)
void UseGdiplus()
@ FORMAT_JPEG
@ FORMAT_TIFF
@ FORMAT_NONE
@ FORMAT_BMP
@ FORMAT_GIF
@ FORMAT_EMFPLUS
@ FORMAT_EMF
@ FORMAT_PNG
@ FORMAT_METAFILE
const Gdiplus::StringFormat * GetGenericTypographic()
void SaveBitmapToStream(Gdiplus::Bitmap &bitmap, IStream *stream, int format)
static int layout(graph_t *g, layout_info *infop, size_t *counter)
Definition layout.c:800
std::vector< WCHAR > text
std::unique_ptr< Gdiplus::Font > font