Util.throwException(new NotSupportedException());
}
};
try{
Bitmap bitmap = new Bitmap(stream);
int width = bitmap.get_Width();
int height = bitmap.get_Height();
int size = width * height;
int[] pixelData = new int[size];
cli.System.Drawing.Rectangle rect = new cli.System.Drawing.Rectangle(0, 0, width, height);
cli.System.Drawing.Imaging.BitmapData data = bitmap.LockBits(rect, ImageLockMode.wrap(ImageLockMode.ReadOnly), PixelFormat.wrap(PixelFormat.Format32bppArgb));
cli.System.IntPtr pixelPtr = data.get_Scan0();
cli.System.Runtime.InteropServices.Marshal.Copy(pixelPtr, pixelData, 0, size);
bitmap.UnlockBits(data);
//source.
setDimensions(width, height);
ColorModel cm = ColorModel.getRGBdefault();