Ejemplo n.º 1
0
 public BitmapLayer(int width, int height, ColorBgra fillColor)
     : base(width, height)
 {
     this.surface = new Surface(width, height);
     // clear to see-through white, 0x00ffffff
     this.Surface.Clear(fillColor);
     this.properties = new BitmapLayerProperties(UserBlendOps.CreateDefaultBlendOp());
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new BitmapLayer of the same size as the given Surface, and either
        /// copies the pixels of the given Surface or takes ownership of it.
        /// </summary>
        /// <param name="surface">The Surface.</param>
        /// <param name="takeOwnership">
        /// true to take ownership of the surface (make sure to Dispose() it yourself), or
        /// false to copy its pixels
        /// </param>
        public BitmapLayer(Surface surface, bool takeOwnership)
            : base(surface.Width, surface.Height)
        {
            if (takeOwnership)
            {
                this.surface = surface;
            }
            else
            {
                this.surface = surface.Clone();
            }

            this.properties = new BitmapLayerProperties(UserBlendOps.CreateDefaultBlendOp());
        }