2 // System.Drawing.TextureBrush.cs
5 // Dennis Hayes (dennish@Raytek.com)
6 // Ravindra (rkumar@novell.com)
8 // (C) 2002 Ximian, Inc
9 // (C) 2004 Novell, Inc.
13 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
15 // Permission is hereby granted, free of charge, to any person obtaining
16 // a copy of this software and associated documentation files (the
17 // "Software"), to deal in the Software without restriction, including
18 // without limitation the rights to use, copy, modify, merge, publish,
19 // distribute, sublicense, and/or sell copies of the Software, and to
20 // permit persons to whom the Software is furnished to do so, subject to
21 // the following conditions:
23 // The above copyright notice and this permission notice shall be
24 // included in all copies or substantial portions of the Software.
26 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 using System.Drawing.Drawing2D;
37 using System.Drawing.Imaging;
40 using geom = java.awt.geom;
41 using image = java.awt.image;
43 namespace System.Drawing
46 /// Summary description for TextureBrush.
48 public sealed class TextureBrush : Brush
50 awt.TexturePaint _nativeObject;
52 protected override java.awt.Paint NativeObject {
61 TextureBrush (awt.TexturePaint ptr)
66 public TextureBrush (Image image) : this (image, WrapMode.Tile)
70 public TextureBrush (Image image, Rectangle dstRect)
74 public TextureBrush (Image image, RectangleF dstRect)
76 // FIXME: check if not metafile
77 _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage,
78 new geom.Rectangle2D.Float((float)dstRect.X,(float)dstRect.Y,(float)dstRect.Width,
79 (float)dstRect.Height));
82 public TextureBrush (Image image, WrapMode wrapMode)
84 // FIXME: check if not metafile
86 _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage,
87 new geom.Rectangle2D.Float(0,0,1,1));
90 public TextureBrush (Image image, Rectangle dstRect, ImageAttributes imageAttr)
92 throw new NotImplementedException();
95 public TextureBrush (Image image, RectangleF dstRect, ImageAttributes imageAttr)
97 throw new NotImplementedException();
100 public TextureBrush (Image image, WrapMode wrapMode, Rectangle dstRect)
102 // FIXME: check if not metafile
104 _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage,
105 new geom.Rectangle2D.Float ((float)dstRect.X,(float)dstRect.Y,(float)dstRect.Width,(float)dstRect.Height));
108 public TextureBrush (Image image, WrapMode wrapMode, RectangleF dstRect)
110 // FIXME: check if not metafile
112 _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage,
113 new geom.Rectangle2D.Float((float)dstRect.X,(float)dstRect.Y,(float)dstRect.Width,
114 (float)dstRect.Height));
120 return Image.ImageFromNativeImage(((awt.TexturePaint)NativeObject).getImage(),
125 public Matrix Transform {
127 throw new NotImplementedException();
130 throw new NotImplementedException();
134 public WrapMode WrapMode {
145 public override object Clone ()
147 throw new NotImplementedException();
150 public void MultiplyTransform (Matrix matrix)
152 MultiplyTransform (matrix, MatrixOrder.Prepend);
155 public void MultiplyTransform (Matrix matrix, MatrixOrder order)
157 throw new NotImplementedException();
160 public void ResetTransform ()
162 throw new NotImplementedException();
165 public void RotateTransform (float angle)
167 RotateTransform (angle, MatrixOrder.Prepend);
170 public void RotateTransform (float angle, MatrixOrder order)
172 throw new NotImplementedException();
175 public void ScaleTransform (float sx, float sy)
177 ScaleTransform (sx, sy, MatrixOrder.Prepend);
180 public void ScaleTransform (float sx, float sy, MatrixOrder order)
182 throw new NotImplementedException();
185 public void TranslateTransform (float dx, float dy)
187 TranslateTransform (dx, dy, MatrixOrder.Prepend);
190 public void TranslateTransform (float dx, float dy, MatrixOrder order)
192 throw new NotImplementedException();