public bool IsVisible(Rectangle_ rect) { bool result; Status status = GDIPlus.GdipIsVisibleRegionRectI(nativeRegion, rect.X, rect.Y, rect.Width, rect.Height, IntPtr.Zero, out result); GDIPlus.CheckStatus(status); return(result); }
public bool IsVisible(Rectangle_ rect, Graphics g) { IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject; bool result; Status status = GDIPlus.GdipIsVisibleRegionRectI(nativeRegion, rect.X, rect.Y, rect.Width, rect.Height, ptr, out result); GDIPlus.CheckStatus(status); return(result); }
public TextureBrush(Image image, Rectangle_ dstRect, ImageAttributes imageAttr) { if (image == null) { throw new ArgumentNullException("image"); } IntPtr attr = imageAttr == null ? IntPtr.Zero : imageAttr.NativeObject; Status status = GDIPlus.GdipCreateTextureIAI(image.nativeObject, attr, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height, out nativeObject); GDIPlus.CheckStatus(status); }
/// <summary> /// Intersect Shared Method /// </summary> /// /// <remarks> /// Produces a new Rectangle_ by intersecting 2 existing /// Rectangles. Returns null if there is no intersection. /// </remarks> public static Rectangle_ Intersect(Rectangle_ a, Rectangle_ b) { // MS.NET returns a non-empty Rectangle_ if the two rectangles // touch each other if (!a.IntersectsWithInclusive(b)) { return(Empty); } return(Rectangle_.FromLTRB( Math.Max(a.Left, b.Left), Math.Max(a.Top, b.Top), Math.Min(a.Right, b.Right), Math.Min(a.Bottom, b.Bottom))); }
// // GetBounds // public RectangleF_ GetBounds(Graphics g) { if (g == null) { throw new ArgumentNullException("g"); } RectangleF_ rect = new Rectangle_(); Status status = GDIPlus.GdipGetRegionBounds(nativeRegion, g.NativeObject, ref rect); GDIPlus.CheckStatus(status); return(rect); }
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); }
public BufferedGraphics Allocate(Graphics targetGraphics, Rectangle_ targetRectangle) { BufferedGraphics graphics = new BufferedGraphics(targetGraphics, targetRectangle); return(graphics); }
private bool IntersectsWithInclusive(Rectangle_ r) { return(!((Left > r.Right) || (Right < r.Left) || (Top > r.Bottom) || (Bottom < r.Top))); }
/// <summary> /// IntersectsWith Method /// </summary> /// /// <remarks> /// Checks if a Rectangle_ intersects with this one. /// </remarks> public bool IntersectsWith(Rectangle_ rect) { return(!((Left >= rect.Right) || (Right <= rect.Left) || (Top >= rect.Bottom) || (Bottom <= rect.Top))); }
/// <summary> /// Contains Method /// </summary> /// /// <remarks> /// Checks if a Rectangle_ lies entirely within this /// Rectangle. /// </remarks> public bool Contains(Rectangle_ rect) { return(rect == Intersect(this, rect)); }
/// <summary> /// Intersect Method /// </summary> /// /// <remarks> /// Replaces the Rectangle_ with the intersection of itself /// and another Rectangle. /// </remarks> public void Intersect(Rectangle_ rect) { this = Rectangle_.Intersect(this, rect); }
public TextureBrush(Image image, Rectangle_ dstRect) : this(image, WrapMode.Tile, dstRect) { }
public Region(Rectangle_ rect) { Status status = GDIPlus.GdipCreateRegionRectI(ref rect, out nativeRegion); GDIPlus.CheckStatus(status); }
public void Xor(Rectangle_ rect) { Status status = GDIPlus.GdipCombineRegionRectI(nativeRegion, ref rect, CombineMode.Xor); GDIPlus.CheckStatus(status); }
public BufferedGraphics Allocate(IntPtr targetDC, Rectangle_ targetRectangle) { throw new NotImplementedException(); }
public BitmapData LockBits(Rectangle_ rect, ImageLockMode flags, PixelFormat format) { BitmapData result = new BitmapData(); return(LockBits(rect, flags, format, result)); }
internal BufferedGraphics(Graphics targetGraphics, Rectangle_ targetRectangle) { size = targetRectangle; target = targetGraphics; membmp = new Bitmap(size.Width, size.Height); }