public Rectangle(Size s) { _x = 0; _y = 0; _width = s.Width; _height = s.Height; }
public Rectangle(Point p, Size s) { _x = p.X; _y = p.Y; _width = s.Width; _height = s.Height; }
public override void OnLayoutChanges(LayoutingType layoutType) { base.OnLayoutChanges (layoutType); if (layoutType == LayoutingType.Width) MinimumPopupSize = new Size (this.Slot.Width, minimumPopupSize.Height); }
protected override void loadFromStream(Stream stream) { using (MemoryStream ms = new MemoryStream ()) { stream.CopyTo (ms); hSVG = new Rsvg.Handle (ms.ToArray ()); Dimensions = new Size (hSVG.Dimensions.Width, hSVG.Dimensions.Height); } }
internal virtual void SetChild(GraphicObject _child) { if (child != null) { contentSize = new Size (0, 0); child.LayoutChanged -= OnChildLayoutChanges; child.Parent = null; this.RegisterForGraphicUpdate (); } child = _child as GraphicObject; if (child != null) { child.Parent = this; child.LayoutChanged += OnChildLayoutChanges; contentSize = child.Slot.Size; child.RegisteredLayoutings = LayoutingType.None; child.RegisterForLayouting (LayoutingType.Sizing); } }
//load image via System.Drawing.Bitmap, cairo load png only void loadBitmap(System.Drawing.Bitmap bitmap) { if (bitmap == null) return; System.Drawing.Imaging.BitmapData data = bitmap.LockBits (new System.Drawing.Rectangle (0, 0, bitmap.Width, bitmap.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); Dimensions = new Size (bitmap.Width, bitmap.Height); int stride = data.Stride; int bitmapSize = Math.Abs (data.Stride) * bitmap.Height; image = new byte[bitmapSize]; System.Runtime.InteropServices.Marshal.Copy (data.Scan0, image, 0, bitmapSize); bitmap.UnlockBits (data); }