public TextureBrush(Image image, WrapMode wrapMode, RectangleF dstRect) { // TBD: check if not metafile _sourceRectangle = dstRect; _texture = (Image)((Bitmap)image).Clone(dstRect, image.PixelFormat); _wrapMode = wrapMode; if (wrapMode != Drawing2D.WrapMode.Tile) { image = CreateWrappedImage(_texture, wrapMode); } else { image = _texture; } _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage, new geom.Rectangle2D.Float(0, 0, image.Width, image.Height)); }
public TextureBrush (Image image, WrapMode wrapMode, RectangleF dstRect) { // TBD: check if not metafile _sourceRectangle = dstRect; _texture = (Image)((Bitmap)image).Clone(dstRect, image.PixelFormat); _wrapMode = wrapMode; if (wrapMode != Drawing2D.WrapMode.Tile) image = CreateWrappedImage(_texture, wrapMode); else image = _texture; _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage, new geom.Rectangle2D.Float(0, 0, image.Width, image.Height)); }