mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 00:42:40 +00:00
parent
dcc512a245
commit
9f4d733d1f
4 changed files with 408 additions and 92 deletions
|
@ -23,6 +23,7 @@ class Image : public GdiplusBase
|
|||
{
|
||||
public:
|
||||
friend class Graphics;
|
||||
friend class TextureBrush;
|
||||
|
||||
Image(IStream *stream, BOOL useEmbeddedColorManagement = FALSE) : nativeImage(NULL)
|
||||
{
|
||||
|
@ -1438,4 +1439,80 @@ class CustomLineCap : public GdiplusBase
|
|||
operator=(const CustomLineCap &);
|
||||
};
|
||||
|
||||
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
|
||||
{
|
||||
#if 1
|
||||
return NULL; // FIXME
|
||||
#else
|
||||
GpImage *image = NULL;
|
||||
GpTexture *texture = GetNativeTexture();
|
||||
SetStatus(DllExports::GdipGetTextureImage(texture, &image));
|
||||
if (lastStatus != Ok)
|
||||
return NULL;
|
||||
|
||||
Image *newImage = new Image(image, lastStatus);
|
||||
if (!newImage)
|
||||
DllExports::GdipDisposeImage(image);
|
||||
return newImage;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* _GDIPLUSHEADERS_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue