FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
pen.c
1
20/* GDI Pen Functions: http://msdn.microsoft.com/en-us/library/dd162790 */
21
22#include <freerdp/config.h>
23
24#include <stdio.h>
25#include <stdlib.h>
26
27#include <freerdp/api.h>
28#include <freerdp/freerdp.h>
29#include <freerdp/gdi/gdi.h>
30
31#include <freerdp/gdi/pen.h>
32
46HGDI_PEN gdi_CreatePen(UINT32 fnPenStyle, UINT32 nWidth, UINT32 crColor, UINT32 format,
47 const gdiPalette* palette)
48{
49 HGDI_PEN hPen = (HGDI_PEN)calloc(1, sizeof(GDI_PEN));
50 if (!hPen)
51 return NULL;
52 hPen->objectType = GDIOBJECT_PEN;
53 hPen->style = fnPenStyle;
54 hPen->color = crColor;
55 WINPR_ASSERT(nWidth <= INT32_MAX);
56 hPen->width = (int)nWidth;
57 hPen->format = format;
58 hPen->palette = palette;
59 return hPen;
60}
61
62UINT32 gdi_GetPenColor(HGDI_PEN pen, UINT32 format)
63{
64 return FreeRDPConvertColor(pen->color, pen->format, format, pen->palette);
65}