Exemple #1
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);
        }
Exemple #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;
 }