示例#1
0
		public static Image Create(Draw.Image image)
		{
			Image result = null;
			if (image is Raster.Image)
			{
				if (image is Raster.Bgra)
					result = new Bgra(image as Raster.Bgra);
				else if (image is Raster.Bgr)
					result = new Bgr(image as Raster.Bgr);
				else if (image is Raster.Monochrome)
					result = new Monochrome(image as Raster.Monochrome);
				else if (image is Raster.Yuv420)
					result = new Yuv420(image as Raster.Yuv420);
				else
					result = new Bgra(image.Convert<Raster.Bgra>());
			}
			else if (image is Image)
				result = image.Copy() as Image;
			else if (image.NotNull())
				result = new Bgra(image.Convert<Raster.Bgra>());
			return result;
		}