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); }
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; }