gdiplus: Added GdipSetPenDashStyle.
This commit is contained in:
parent
1182162dac
commit
daf00ab72a
|
@ -549,7 +549,7 @@
|
|||
@ stub GdipSetPenDashArray
|
||||
@ stub GdipSetPenDashCap197819
|
||||
@ stub GdipSetPenDashOffset
|
||||
@ stub GdipSetPenDashStyle
|
||||
@ stdcall GdipSetPenDashStyle(ptr long)
|
||||
@ stdcall GdipSetPenEndCap(ptr long)
|
||||
@ stdcall GdipSetPenLineCap197819(ptr long long long)
|
||||
@ stdcall GdipSetPenLineJoin(ptr long)
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "windef.h"
|
||||
#include "gdiplus.h"
|
||||
|
||||
#define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_ENDCAP_FLAT | PS_JOIN_MITER)
|
||||
#define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER)
|
||||
#define MAX_ARC_PTS (13)
|
||||
|
||||
COLORREF ARGB2COLORREF(ARGB color);
|
||||
|
@ -51,6 +51,7 @@ struct GpPen{
|
|||
GpDashCap dashcap;
|
||||
GpLineJoin join;
|
||||
REAL miterlimit;
|
||||
GpDashStyle dash;
|
||||
};
|
||||
|
||||
struct GpGraphics{
|
||||
|
|
|
@ -27,6 +27,28 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
static DWORD gdip_to_gdi_dash(GpDashStyle dash)
|
||||
{
|
||||
switch(dash){
|
||||
case DashStyleSolid:
|
||||
return PS_SOLID;
|
||||
case DashStyleDash:
|
||||
return PS_DASH;
|
||||
case DashStyleDot:
|
||||
return PS_DOT;
|
||||
case DashStyleDashDot:
|
||||
return PS_DASHDOT;
|
||||
case DashStyleDashDotDot:
|
||||
return PS_DASHDOTDOT;
|
||||
case DashStyleCustom:
|
||||
FIXME("DashStyleCustom not implemented\n");
|
||||
return PS_SOLID;
|
||||
default:
|
||||
ERR("Not a member of GpDashStyle enumeration\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static DWORD gdip_to_gdi_join(GpLineJoin join)
|
||||
{
|
||||
switch(join){
|
||||
|
@ -91,6 +113,28 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
|
||||
{
|
||||
LOGBRUSH lb;
|
||||
|
||||
if(!pen)
|
||||
return InvalidParameter;
|
||||
|
||||
DeleteObject(pen->gdipen);
|
||||
pen->dash = dash;
|
||||
pen->style &= ~(PS_ALTERNATE | PS_SOLID | PS_DASH | PS_DOT | PS_DASHDOT |
|
||||
PS_DASHDOTDOT | PS_NULL | PS_USERSTYLE | PS_INSIDEFRAME);
|
||||
pen->style |= gdip_to_gdi_dash(dash);
|
||||
|
||||
lb.lbStyle = BS_SOLID;
|
||||
lb.lbColor = pen->color;
|
||||
lb.lbHatch = 0;
|
||||
|
||||
pen->gdipen = ExtCreatePen(pen->style, (INT) pen->width, &lb, 0, NULL);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen *pen, GpLineCap cap)
|
||||
{
|
||||
if(!pen) return InvalidParameter;
|
||||
|
|
|
@ -141,6 +141,16 @@ enum DashCap
|
|||
DashCapTriangle = 3
|
||||
};
|
||||
|
||||
enum DashStyle
|
||||
{
|
||||
DashStyleSolid,
|
||||
DashStyleDash,
|
||||
DashStyleDot,
|
||||
DashStyleDashDot,
|
||||
DashStyleDashDotDot,
|
||||
DashStyleCustom
|
||||
};
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
typedef enum Unit Unit;
|
||||
|
@ -155,6 +165,7 @@ typedef enum CompositingQuality CompositingQuality;
|
|||
typedef enum InterpolationMode InterpolationMode;
|
||||
typedef enum PixelOffsetMode PixelOffsetMode;
|
||||
typedef enum DashCap DashCap;
|
||||
typedef enum DashStyle DashStyle;
|
||||
|
||||
#endif /* end of c typedefs */
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ extern "C" {
|
|||
|
||||
GpStatus WINGDIPAPI GdipCreatePen1(ARGB,REAL,GpUnit,GpPen**);
|
||||
GpStatus WINGDIPAPI GdipDeletePen(GpPen*);
|
||||
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle);
|
||||
GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap);
|
||||
GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap);
|
||||
GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen*,GpLineJoin);
|
||||
|
|
|
@ -51,5 +51,6 @@ typedef LineCap GpLineCap;
|
|||
typedef RectF GpRectF;
|
||||
typedef LineJoin GpLineJoin;
|
||||
typedef DashCap GpDashCap;
|
||||
typedef DashStyle GpDashStyle;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue