Example #1
0
        public TextureBrush(Image image, WrapMode wrapMode, RectangleF dstRect)
        {
            if (image == null)
            {
                throw new ArgumentNullException("image");
            }
            if ((wrapMode < WrapMode.Tile) || (wrapMode > WrapMode.Clamp))
            {
                throw new InvalidEnumArgumentException("WrapMode");
            }

            Status status = GDIPlus.GdipCreateTexture2(image.nativeObject, wrapMode, dstRect.X, dstRect.Y,
                                                       dstRect.Width, dstRect.Height, out nativeObject);

            GDIPlus.CheckStatus(status);
        }