|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951 |
- /**************************************************************************\
- *
- * Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
- *
- * Module Name:
- *
- * GdiplusBrush.h
- *
- * Abstract:
- *
- * Brush API related declarations
- *
- \**************************************************************************/
-
- #ifndef _GDIPLUSBRUSH_H
- #define _GDIPLUSBRUSH_H
-
- //--------------------------------------------------------------------------
- // Abstract base class for various brush types
- //--------------------------------------------------------------------------
-
- class GraphicsPath;
-
- class Brush : public GdiplusBase
- {
- public:
- friend class Pen;
- friend class Graphics;
-
- virtual ~Brush()
- {
- DllExports::GdipDeleteBrush(nativeBrush);
- }
-
- virtual Brush* Clone() const
- {
- GpBrush *brush = NULL;
-
- SetStatus(DllExports::GdipCloneBrush(nativeBrush, &brush));
-
- Brush *newBrush = new Brush(brush, lastResult);
-
- if (newBrush == NULL)
- {
- DllExports::GdipDeleteBrush(brush);
- }
-
- return newBrush;
- }
-
- BrushType GetType() const
- {
- BrushType type = static_cast<BrushType>(-1);
-
- SetStatus(DllExports::GdipGetBrushType(nativeBrush, &type));
-
- return type;
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
- protected:
-
- Brush()
- {
- SetStatus(NotImplemented);
- }
-
- #ifdef DCR_USE_NEW_250932
-
- private:
- Brush(const Brush& brush);
- Brush& operator=(const Brush& brush);
- protected:
-
- #else
-
- Brush(const Brush& brush)
- {
- brush;
- SetStatus(NotImplemented);
- }
-
- Brush& operator=(const Brush& brush)
- {
- brush;
- SetStatus(NotImplemented);
- return *this;
- }
-
- #endif
-
- Brush(GpBrush* nativeBrush, Status status)
- {
- lastResult = status;
- SetNativeBrush(nativeBrush);
- }
-
- VOID SetNativeBrush(GpBrush* nativeBrush)
- {
- this->nativeBrush = nativeBrush;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
- GpBrush* nativeBrush;
- mutable Status lastResult;
- };
-
- //--------------------------------------------------------------------------
- // Represent solid fill brush object
- //--------------------------------------------------------------------------
-
- class SolidBrush : public Brush
- {
- public:
- friend class Pen;
-
- SolidBrush(IN const Color& color)
- {
- GpSolidFill *brush = NULL;
-
- lastResult = DllExports::GdipCreateSolidFill(color.GetValue(), &brush);
-
- SetNativeBrush(brush);
- }
-
- Status GetColor(OUT Color* color) const
- {
- ARGB argb;
-
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- SetStatus(DllExports::GdipGetSolidFillColor((GpSolidFill*)nativeBrush,
- &argb));
-
- *color = Color(argb);
-
- return lastResult;
- }
-
- Status SetColor(IN const Color& color)
- {
- return SetStatus(DllExports::GdipSetSolidFillColor((GpSolidFill*)nativeBrush,
- color.GetValue()));
- }
-
- #ifdef DCR_USE_NEW_250932
-
- private:
- SolidBrush(const SolidBrush &);
- SolidBrush& operator=(const SolidBrush &);
-
- #endif
-
- protected:
-
- SolidBrush()
- {
- }
- };
-
- class TextureBrush : public Brush
- {
- public:
- friend class Pen;
-
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode = WrapModeTile)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture(
- image->nativeImage,
- wrapMode, &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode,
- IN const RectF &dstRect)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2(
- image->nativeImage,
- wrapMode,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
-
- TextureBrush(IN Image *image,
- IN const RectF &dstRect,
- IN const ImageAttributes *imageAttributes = NULL)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTextureIA(
- image->nativeImage,
- (imageAttributes)?imageAttributes->nativeImageAttr:NULL,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture
- );
-
- SetNativeBrush(texture);
- }
-
- #ifdef DCR_USE_NEW_145138
- TextureBrush(IN Image *image,
- IN const Rect &dstRect,
- IN const ImageAttributes *imageAttributes = NULL)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTextureIAI(
- image->nativeImage,
- (imageAttributes)?imageAttributes->nativeImageAttr:NULL,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture
- );
-
- SetNativeBrush(texture);
- }
- #endif
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
-
- TextureBrush(
- IN Image* image,
- IN WrapMode wrapMode,
-
- #ifdef DCR_USE_NEW_145138
- const IN Rect &dstRect
- #else
- IN Rect &dstRect
- #endif
- )
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2I(
- image->nativeImage,
- wrapMode,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode,
- IN REAL dstX,
- IN REAL dstY,
- IN REAL dstWidth,
- IN REAL dstHeight)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2(
- image->nativeImage,
- wrapMode,
- dstX,
- dstY,
- dstWidth,
- dstHeight,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode,
- IN INT dstX,
- IN INT dstY,
- IN INT dstWidth,
- IN INT dstHeight)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2I(
- image->nativeImage,
- wrapMode,
- dstX,
- dstY,
- dstWidth,
- dstHeight,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- /**
- * Set/get brush transform
- */
- Status SetTransform(IN const Matrix* matrix)
- {
- return SetStatus(DllExports::GdipSetTextureTransform((GpTexture*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status GetTransform(OUT Matrix* matrix) const
- {
- return SetStatus(DllExports::GdipGetTextureTransform((GpTexture*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status ResetTransform()
- {
- return SetStatus(DllExports::GdipResetTextureTransform((GpTexture*)nativeBrush));
- }
-
- Status MultiplyTransform(IN const Matrix* matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyTextureTransform((GpTexture*)nativeBrush,
- matrix->nativeMatrix,
- order));
- }
-
- Status TranslateTransform(IN REAL dx,
- IN REAL dy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslateTextureTransform((GpTexture*)nativeBrush,
- dx, dy, order));
- }
-
- Status ScaleTransform(IN REAL sx,
- IN REAL sy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScaleTextureTransform((GpTexture*)nativeBrush,
- sx, sy, order));
- }
-
- Status RotateTransform(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotateTextureTransform((GpTexture*)nativeBrush,
- angle, order));
- }
-
- /**
- * Set/get brush wrapping mode
- */
- Status SetWrapMode(IN WrapMode wrapMode)
- {
- return SetStatus(DllExports::GdipSetTextureWrapMode((GpTexture*)nativeBrush,
- wrapMode));
- }
-
- WrapMode GetWrapMode() const
- {
- WrapMode wrapMode;
-
- SetStatus(DllExports::GdipGetTextureWrapMode((GpTexture*)nativeBrush,
- &wrapMode));
- return wrapMode;
- }
-
- // Get texture brush attributes
-
- Image *GetImage() const
- {
- GpImage *image;
-
- SetStatus(DllExports::GdipGetTextureImage((GpTexture *)nativeBrush,
- &image));
-
- Image *retimage = new Image(image, lastResult);
-
- if (retimage == NULL)
- {
- DllExports::GdipDisposeImage(image);
- }
-
- return retimage;
- }
-
- #ifdef DCR_USE_NEW_250932
-
- private:
- TextureBrush(const TextureBrush &);
- TextureBrush& operator=(const TextureBrush &);
-
- #endif
-
- protected:
-
- TextureBrush()
- {
- }
- };
-
- //--------------------------------------------------------------------------
- // Represent line gradient brush object
- //--------------------------------------------------------------------------
-
- class LinearGradientBrush : public Brush
- {
- public:
- friend class Pen;
-
- LinearGradientBrush(IN const PointF& point1,
- IN const PointF& point2,
- IN const Color& color1,
- IN const Color& color2)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrush(&point1,
- &point2,
- color1.GetValue(),
- color2.GetValue(),
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const Point& point1,
- IN const Point& point2,
- IN const Color& color1,
- IN const Color& color2)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushI(&point1,
- &point2,
- color1.GetValue(),
- color2.GetValue(),
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const RectF& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN LinearGradientMode mode)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRect(&rect,
- color1.GetValue(),
- color2.GetValue(),
- mode,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const Rect& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN LinearGradientMode mode)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRectI(&rect,
- color1.GetValue(),
- color2.GetValue(),
- mode,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const RectF& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN REAL angle,
- IN BOOL isAngleScalable = FALSE)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRectWithAngle(&rect,
- color1.GetValue(),
- color2.GetValue(),
- angle,
- isAngleScalable,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const Rect& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN REAL angle,
- IN BOOL isAngleScalable = FALSE)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRectWithAngleI(&rect,
- color1.GetValue(),
- color2.GetValue(),
- angle,
- isAngleScalable,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- // Get/set point attributes
-
- Status SetLinearPoints(IN const PointF& point1,
- IN const PointF& point2)
- {
- return SetStatus(DllExports::GdipSetLinePoints((GpLineGradient*)nativeBrush,
- &point1, &point2));
- }
-
- Status GetLinearPoints(OUT PointF* points) const
- {
- return SetStatus(DllExports::GdipGetLinePoints((GpLineGradient*) nativeBrush,
- points));
- }
-
- Status SetLinearPoints(IN const Point& point1,
- IN const Point& point2)
- {
- return SetStatus(DllExports::GdipSetLinePointsI((GpLineGradient*)nativeBrush,
- &point1, &point2));
- }
-
- Status GetLinearPoints(OUT Point* points) const
- {
- return SetStatus(DllExports::GdipGetLinePointsI((GpLineGradient*) nativeBrush,
- points));
- }
- // Get/set color attributes
-
- Status SetLinearColors(IN const Color& color1,
- IN const Color& color2)
- {
- return SetStatus(DllExports::GdipSetLineColors((GpLineGradient*)nativeBrush,
- color1.GetValue(),
- color2.GetValue()));
- }
-
- Status GetLinearColors(OUT Color* colors) const
- {
- ARGB argb[2];
-
- if (colors == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- SetStatus(DllExports::GdipGetLineColors((GpLineGradient*) nativeBrush, argb));
-
- if (lastResult == Ok)
- {
- // use bitwise copy operator for Color copy
- colors[0] = Color(argb[0]);
- colors[1] = Color(argb[1]);
- }
-
- return lastResult;
- }
-
- Status GetRectangle(OUT RectF* rect) const
- {
- return SetStatus(DllExports::GdipGetLineRect((GpLineGradient*)nativeBrush, rect));
- }
-
- // integer version
- Status GetRectangle(OUT Rect* rect) const
- {
- return SetStatus(DllExports::GdipGetLineRectI((GpLineGradient*)nativeBrush, rect));
- }
-
- // Gamma correction in interporlation.
-
- Status SetGammaCorrection(IN BOOL useGammaCorrection)
- {
- return SetStatus(DllExports::GdipSetLineGammaCorrection((GpLineGradient*)nativeBrush,
- useGammaCorrection));
- }
-
- BOOL GetGammaCorrection() const
- {
- BOOL useGammaCorrection;
-
- SetStatus(DllExports::GdipGetLineGammaCorrection((GpLineGradient*)nativeBrush,
- &useGammaCorrection));
-
- return useGammaCorrection;
- }
-
- INT GetBlendCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetLineBlendCount((GpLineGradient*)
- nativeBrush,
- &count));
-
- return count;
- }
-
- Status SetBlend(IN const REAL* blendFactors,
- IN const REAL* blendPositions,
- IN INT count)
- {
- return SetStatus(DllExports::GdipSetLineBlend((GpLineGradient*)
- nativeBrush,
- blendFactors,
- blendPositions,
- count));
- }
-
- Status GetBlend(OUT REAL* blendFactors,
- OUT REAL* blendPositions,
- IN INT count) const
- {
- return SetStatus(DllExports::GdipGetLineBlend((GpLineGradient*)nativeBrush,
- blendFactors,
- blendPositions,
- count));
- }
-
- INT GetInterpolationColorCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetLinePresetBlendCount((GpLineGradient*)
- nativeBrush,
- &count));
-
- return count;
- }
-
- Status SetInterpolationColors(IN const Color* presetColors,
- IN const REAL* blendPositions,
- IN INT count)
- {
- if ((count <= 0) || !presetColors)
- return SetStatus(InvalidParameter);
-
- ARGB *argbs = (ARGB*) new BYTE[count*sizeof(ARGB)];
-
- if (argbs)
- {
- for (INT i = 0; i < count; i++)
- {
- argbs[i] = presetColors[i].GetValue();
- }
-
- Status status = SetStatus(DllExports::GdipSetLinePresetBlend(
- (GpLineGradient*) nativeBrush,
- argbs,
- blendPositions,
- count));
- delete [] argbs;
- return status;
- }
- else
- {
- return SetStatus(OutOfMemory);
- }
- }
-
- Status GetInterpolationColors(OUT Color* presetColors,
- OUT REAL* blendPositions,
- IN INT count) const
- {
- if ((count <= 0) || !presetColors)
- return SetStatus(InvalidParameter);
-
- ARGB* argbs = (ARGB*) new BYTE[count*sizeof(ARGB)];
-
- if (!argbs)
- {
- return SetStatus(OutOfMemory);
- }
-
- Status status = SetStatus(DllExports::GdipGetLinePresetBlend((GpLineGradient*)nativeBrush,
- argbs,
- blendPositions,
- count));
- if (status == Ok)
- {
- for (INT i = 0; i < count; i++)
- {
- presetColors[i] = Color(argbs[i]);
- }
- }
-
- delete [] argbs;
-
- return status;
- }
-
- Status SetBlendBellShape(IN REAL focus,
- IN REAL scale = 1.0)
- {
- return SetStatus(DllExports::GdipSetLineSigmaBlend((GpLineGradient*)nativeBrush, focus, scale));
- }
-
- #ifdef DCR_USE_NEW_145135
- Status SetBlendTriangularShape(
- IN REAL focus,
- IN REAL scale = 1.0
- )
- #else
- Status SetBlendTrianglarShape(IN REAL focus,
- IN REAL scale = 1.0)
- #endif
- {
- return SetStatus(DllExports::GdipSetLineLinearBlend((GpLineGradient*)nativeBrush, focus, scale));
- }
-
- /**
- * Set/get brush transform
- */
- Status SetTransform(IN const Matrix* matrix)
- {
- return SetStatus(DllExports::GdipSetLineTransform((GpLineGradient*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status GetTransform(OUT Matrix *matrix) const
- {
- return SetStatus(DllExports::GdipGetLineTransform((GpLineGradient*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status ResetTransform()
- {
- return SetStatus(DllExports::GdipResetLineTransform((GpLineGradient*)nativeBrush));
- }
-
- Status MultiplyTransform(IN const Matrix* matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyLineTransform((GpLineGradient*)nativeBrush,
- matrix->nativeMatrix,
- order));
- }
-
- Status TranslateTransform(IN REAL dx,
- IN REAL dy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslateLineTransform((GpLineGradient*)nativeBrush,
- dx, dy, order));
- }
-
- Status ScaleTransform(IN REAL sx,
- IN REAL sy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScaleLineTransform((GpLineGradient*)nativeBrush,
- sx, sy, order));
- }
-
- Status RotateTransform(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotateLineTransform((GpLineGradient*)nativeBrush,
- angle, order));
- }
-
- /**
- * Set/get brush wrapping mode
- */
- Status SetWrapMode(IN WrapMode wrapMode)
- {
- return SetStatus(DllExports::GdipSetLineWrapMode((GpLineGradient*)nativeBrush,
- wrapMode));
- }
-
- WrapMode GetWrapMode() const
- {
- WrapMode wrapMode;
-
- SetStatus(DllExports::GdipGetLineWrapMode((GpLineGradient*)
- nativeBrush,
- &wrapMode));
-
- return wrapMode;
- }
-
- #ifdef DCR_USE_NEW_250932
-
- private:
- LinearGradientBrush(const LinearGradientBrush &);
- LinearGradientBrush& operator=(const LinearGradientBrush &);
-
- #endif
-
- protected:
-
- LinearGradientBrush()
- {
- }
- };
-
- //--------------------------------------------------------------------------
- // PathGradientBrush object is defined
- // in gdipluspath.h.
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- // Represent hatch brush object
- //--------------------------------------------------------------------------
-
- class HatchBrush : public Brush
- {
- public:
- friend class Pen;
-
- // Constructors
-
- HatchBrush(IN HatchStyle hatchStyle,
- IN const Color& foreColor,
- IN const Color& backColor = Color())
- {
- GpHatch *brush = NULL;
-
- lastResult = DllExports::GdipCreateHatchBrush(hatchStyle,
- foreColor.GetValue(),
- backColor.GetValue(),
- &brush);
- SetNativeBrush(brush);
- }
-
- HatchStyle GetHatchStyle() const
- {
- HatchStyle hatchStyle;
-
- SetStatus(DllExports::GdipGetHatchStyle((GpHatch*)nativeBrush,
- &hatchStyle));
-
- return hatchStyle;
- }
-
- Status GetForegroundColor(OUT Color* color) const
- {
- ARGB argb;
-
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- Status status = SetStatus(DllExports::GdipGetHatchForegroundColor(
- (GpHatch*)nativeBrush,
- &argb));
-
- color->SetValue(argb);
-
- return status;
- }
-
- Status GetBackgroundColor(OUT Color *color) const
- {
- ARGB argb;
-
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- Status status = SetStatus(DllExports::GdipGetHatchBackgroundColor(
- (GpHatch*)nativeBrush,
- &argb));
-
- color->SetValue(argb);
-
- return status;
- }
-
- #ifdef DCR_USE_NEW_250932
-
- private:
- HatchBrush(const HatchBrush &);
- HatchBrush& operator=(const HatchBrush &);
-
- #endif
-
- protected:
-
- HatchBrush()
- {
- }
- };
-
- #endif
|