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

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

            GDIPlus.CheckStatus(status);
        }