Ejemplo n.º 1
0
        public Canvas CreateSimilar(int width, int height, int numChannels)
        {
            if (width < 0)
            {
                width = this.Width;
            }
            if (height < 0)
            {
                height = this.Height;
            }
            //if (numChannels < 1)
            //    numChannels = this.

            PixelDataProvider pdp = this._pdp.CreateSimilar(width, height, numChannels);
            Canvas            c   = Canvas.Create(pdp);

            c.ClipRectangle = this.ClipRectangle.Copy();
            return(c);
        }
Ejemplo n.º 2
0
        public static Canvas Create(PixelDataProvider pdp)
        {
            Canvas c = null;

            switch (pdp.BitsPerPixel)
            {
            case 32:
                c = new Canvas32();
                break;

            case 24:
                c = new Canvas24();
                break;

            case 8:
                c = new Canvas8();
                break;

            default:
                return(null);
            }
            c.PixelDataProvider = pdp;
            return(c);
        }
Ejemplo n.º 3
0
 public static Canvas Create(PixelDataProvider pdp)
 {
     Canvas c = null;
     switch (pdp.BitsPerPixel)
     {
         case 32:
             c = new Canvas32();
             break;
         case 24:
             c = new Canvas24();
             break;
         case 8:
             c = new Canvas8();
             break;
         default:
             return null;
     }
     c.PixelDataProvider = pdp;
     return c;
 }