Exemplo n.º 1
0
        public Bitmap(string filename, bool useIcm)
        {
            if (filename == null)
            {
                throw new ArgumentNullException("filename");
            }

            IntPtr imagePtr;
            Status st;

            if (useIcm)
            {
                st = GDIPlus.GdipCreateBitmapFromFileICM(filename, out imagePtr);
            }
            else
            {
                st = GDIPlus.GdipCreateBitmapFromFile(filename, out imagePtr);
            }

            GDIPlus.CheckStatus(st);
            nativeObject = imagePtr;
        }