mirror of
https://github.com/reactos/reactos.git
synced 2025-06-12 02:18:30 +00:00
[SDK][INCLUDE] Move Gdiplus::TextureBrush codes (#2208)
Move the code into the place it should be in. CORE-16585
This commit is contained in:
parent
f944f3a6cd
commit
1a3c77dc2f
2 changed files with 67 additions and 65 deletions
|
@ -495,18 +495,70 @@ class SolidBrush : Brush
|
|||
}
|
||||
};
|
||||
|
||||
// get native
|
||||
GpImage *&
|
||||
getNat(const Image *image);
|
||||
|
||||
class TextureBrush : Brush
|
||||
{
|
||||
public:
|
||||
// Defined in "gdiplusheaders.h":
|
||||
TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect);
|
||||
TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes);
|
||||
TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight);
|
||||
TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight);
|
||||
TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes);
|
||||
TextureBrush(Image *image, WrapMode wrapMode);
|
||||
TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect);
|
||||
TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus = DllExports::GdipCreateTexture2(
|
||||
getNat(image), wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL;
|
||||
lastStatus = DllExports::GdipCreateTextureIA(
|
||||
getNat(image), attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus =
|
||||
DllExports::GdipCreateTexture2I(getNat(image), wrapMode, dstX, dstY, dstWidth, dstHeight, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus = DllExports::GdipCreateTexture2(getNat(image), wrapMode, dstX, dstY, dstWidth, dstHeight, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL;
|
||||
lastStatus = DllExports::GdipCreateTextureIA(
|
||||
getNat(image), attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
TextureBrush(Image *image, WrapMode wrapMode)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus = DllExports::GdipCreateTexture(getNat(image), wrapMode, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus = DllExports::GdipCreateTexture2I(
|
||||
getNat(image), wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
// Defined in "gdiplusheaders.h":
|
||||
Image *
|
||||
GetImage() const;
|
||||
|
||||
|
|
|
@ -377,6 +377,13 @@ class Image : public GdiplusBase
|
|||
Image(const Image &);
|
||||
Image &
|
||||
operator=(const Image &);
|
||||
|
||||
// get native
|
||||
friend inline GpImage *&
|
||||
getNat(const Image *image)
|
||||
{
|
||||
return const_cast<Image *>(image)->nativeImage;
|
||||
}
|
||||
};
|
||||
|
||||
class Bitmap : public Image
|
||||
|
@ -1446,63 +1453,6 @@ class CustomLineCap : public GdiplusBase
|
|||
}
|
||||
};
|
||||
|
||||
inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus = DllExports::GdipCreateTexture2(
|
||||
image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
inline TextureBrush::TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL;
|
||||
lastStatus = DllExports::GdipCreateTextureIA(
|
||||
image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT dstHeight)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus =
|
||||
DllExports::GdipCreateTexture2I(image->nativeImage, wrapMode, dstX, dstY, dstWidth, dstHeight, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth, REAL dstHeight)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus =
|
||||
DllExports::GdipCreateTexture2(image->nativeImage, wrapMode, dstX, dstY, dstWidth, dstHeight, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
inline TextureBrush::TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr : NULL;
|
||||
lastStatus = DllExports::GdipCreateTextureIA(
|
||||
image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus = DllExports::GdipCreateTexture(image->nativeImage, wrapMode, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect)
|
||||
{
|
||||
GpTexture *texture = NULL;
|
||||
lastStatus = DllExports::GdipCreateTexture2I(
|
||||
image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, &texture);
|
||||
SetNativeBrush(texture);
|
||||
}
|
||||
|
||||
inline Image *
|
||||
TextureBrush::GetImage() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue